makepkg(1)
Build packages from source using a PKGBUILD recipe in Arch Linux.
Synopsis
makepkg [OPTION]... [VARIABLE=VALUE]...Description
makepkg is the build system used by Arch Linux to compile and package software from source. It reads a PKGBUILD file in the current directory that contains metadata, dependencies, and build instructions, then automatically downloads sources, applies patches, compiles code, and creates a binary package (.pkg.tar.zst).
The tool handles source verification, dependency checking, and applies Arch-specific optimizations. It's designed to be simple yet powerful, making it easy to build packages reproducibly or customize existing ones for your system.
Common options
| Flag | What it does |
|---|---|
-s, --syncdeps | Automatically install missing dependencies before building |
-i, --install | Install the package after building successfully |
-c, --clean | Remove build directory and temporary files before building |
-f, --force | Overwrite existing package files without prompting |
-e, --noextract | Do not extract source files; use existing ones |
-A, --ignorearch | Build for any architecture, ignoring PKGBUILD arch restrictions |
-p <file> | Use an alternate PKGBUILD file instead of ./PKGBUILD |
-d, --nodeps | Skip all dependency checks (dangerous) |
-L, --log | Write build output to a log file |
--sign | Sign the resulting package with GPG |
Examples
Build package, install dependencies automatically, and install the finished package
makepkg -siClean build directory, then build from scratch
makepkg -cBuild and overwrite any existing package file without prompting
makepkg -fBuild using a custom PKGBUILD file instead of the default
makepkg -p custom.PKGBUILDBuild package ignoring its declared architecture restrictions
makepkg -A --ignorearchBuild and log output to build.log file
makepkg -LBuild an AUR package with automatic dependency resolution and installation
cd ~/aur/mypackage && makepkg --syncdeps --install