$linuxjunkies
>

makepkg(1)

Build packages from source using a PKGBUILD recipe in Arch Linux.

UbuntuDebianFedoraArch

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

FlagWhat it does
-s, --syncdepsAutomatically install missing dependencies before building
-i, --installInstall the package after building successfully
-c, --cleanRemove build directory and temporary files before building
-f, --forceOverwrite existing package files without prompting
-e, --noextractDo not extract source files; use existing ones
-A, --ignorearchBuild for any architecture, ignoring PKGBUILD arch restrictions
-p <file>Use an alternate PKGBUILD file instead of ./PKGBUILD
-d, --nodepsSkip all dependency checks (dangerous)
-L, --logWrite build output to a log file
--signSign the resulting package with GPG

Examples

Build package, install dependencies automatically, and install the finished package

makepkg -si

Clean build directory, then build from scratch

makepkg -c

Build and overwrite any existing package file without prompting

makepkg -f

Build using a custom PKGBUILD file instead of the default

makepkg -p custom.PKGBUILD

Build package ignoring its declared architecture restrictions

makepkg -A --ignorearch

Build and log output to build.log file

makepkg -L

Build an AUR package with automatic dependency resolution and installation

cd ~/aur/mypackage && makepkg --syncdeps --install

Related commands