MAKEPKG(8)
๐ MAKEPKG(8) โ the Pacman Manual, bestie edition ๐
okay so. makepkg is part of the Pacman Manual and honestly? she's the whole personality of building packages. let's get into it ๐ซถ
โจ NAME โจ
makepkg โ package build utility ๐
๐ธ SYNOPSIS ๐ธ
makepkg [options] [ENVVAR=value] [ENVVAR+=value] ...
๐ฆ DESCRIPTION ๐ฆ
makepkg is a script that automates the building of packages. the requirements to use her are: a build-capable *nix platform, and a custom build script for each package you wanna build (this is called a PKGBUILD). go read PKGBUILD(5) for all the deets on writing your own build scripts, iykyk.
the way that script-based builds are iconic is that the work is only done once. once you have the build script for a package, makepkg does the rest: download and validate source files, check dependencies, configure the build-time settings, build the package, install the package into a temporary root, make customizations, generate meta-info, and package the whole thing up for pacman to use. she literally does everything. main character energy fr fr โจ
Note ๐makepkguses your current locale by default and does not unset it when building packages. so if you wanna share your build output with others when you're asking for help, or for literally any other reason, you might wanna run"LC_ALL=C makepkg"so your logs and output aren't localized. periodt.
๐ OPTIONS ๐
-A,--ignorearchโ ignore a missing or incompletearchfield in the build script. this one's for rebuilding packages from source when the PKGBUILD is maybe a little outdated and hasn't been updated with anarch=('yourarch')field. lowkey relatable.-c,--cleanโ clean up leftover work files and directories after a successful build. we love a tidy queen ๐งน--config <file>โ use an alternate configuration file instead of the/etc/makepkg.confdefault.-d,--nodepsโ do not perform any dependency checks. this lets you override and ignore any dependencies required. but bestie, listen: there is a good chance this option will break the build process if all of the dependencies are not installed. ๐-e,--noextractโ do not extract source files or run theprepare()function (if present); just use whatever source already exists in the$srcdir/directory. this is handy if you wanna go into$srcdir/and manually patch or tweak code, then make a package out of the result. keep in mind that creating a patch may be a better solution to allow others to use your PKGBUILD tho ๐ซถ--verifysourceโ for each source file in thesourcearray of PKGBUILD, download the file if required and perform the integrity checks. no extraction or build is performed. dependencies specified in the PKGBUILD will not be handled unless--syncdepsis used. useful for performing subsequent offline builds.-f,--forceโmakepkgwill not build a package if a built package already exists in thePKGDEST(set inmakepkg.conf(5)) directory, which may default to the current directory. this option allows the built package to be overwritten. she said move over ๐-g,--genintegโ for each source file in thesourcearray of PKGBUILD, download the file if required and generate integrity checks. the integrity checks generated are determined by the checks present in the PKGBUILD, falling back to the value of theINTEGRITY_CHECKarray inmakepkg.conf(5)if these are absent. this output can be redirected into your PKGBUILD for source validation using"makepkg -g >> PKGBUILD". so easy โจ--skipintegโ do not perform any integrity checks (checksum and PGP) on source files.--skipchecksumsโ do not verify checksums of source files.--skippgpcheckโ do not verify PGP signatures of source files.-h,--helpโ output syntax and command line options.--holdverโ when using VCS sources (PKGBUILD(5)) any currently checked out source will not be updated to the latest revision. she's staying right where she is ๐-i,--installโ install or upgrade the package after a successful build usingpacman(8).-L,--logโ enable logging. this will use theteeprogram to send the output of each of the PKGBUILD functions to both the console and to a text file in the build directory namedpkgbase-pkgver-pkgrel-arch-<function>.log. as mentioned above, the logs will be localized so you may wanna set your locale accordingly if you're sharing the log output with others ๐-m,--nocolorโ disable color in output messages. (sad, i know, but sometimes you gotta ๐ฅฒ)-o,--nobuildโ download and extract files, run theprepare()function, but do not build them. useful with the--noextractoption if you wish to tweak the files in$srcdir/before building.-p <buildscript>โ read the package script buildscript instead of thePKGBUILDdefault; seePKGBUILD(5). the buildscript must be located in the directorymakepkgis called from. no wandering off, she has to be right there ๐-r,--rmdepsโ upon successful build, remove any dependencies installed bymakepkgduring dependency auto-resolution and installation when using-s.-R,--repackageโ repackage contents of the package without rebuilding the package. this is useful if you forgot, for example, a dependency or install file in your PKGBUILD and the build itself will not change. been there ๐ญ-s,--syncdepsโ install missing dependencies using pacman. when build-time or run-time dependencies are not found, pacman will try to resolve them. if successful, the missing packages will be downloaded and installed. slay ๐ซถ-S,--sourceโ do not actually build the package, but build a source-only tarball that does not include sources that can be fetched via a download URL. this is useful for passing a single tarball to another program such as a chroot, remote builder, or a tarball upload. because integrity checks are verified, all source files of the package need to be present or downloadable.-V,--versionโ display version information.-C,--cleanbuildโ clean build artifacts from previous runs ofmakepkgin the current directory by removing$srcdirbefore building the package. out with the old ๐งผ-D <dir>,--dir <dir>โ change to directory <dir> before reading the PKGBUILD or doing anything else. first thing she does, no cap.--allsourceโ do not actually build the package, but build a source-only tarball that includes all sources, including those that are normally downloaded viamakepkg. this is useful for passing a single tarball to another program such as a chroot or remote builder. it will also satisfy requirements of the GPL when distributing binary packages. iconic, honestly.--checkโ run thecheck()function in the PKGBUILD, overriding the setting inmakepkg.conf(5).--noarchiveโ do not create the archive at the end of the build process. this can be useful to test thepackage()function or if your target distribution does not use pacman.--nocheckโ do not run thecheck()function in the PKGBUILD or handle the checkdepends.--noprepareโ do not run theprepare()function in the PKGBUILD.--noverifyโ do not run theverify()function in the PKGBUILD.--signโ sign the resulting package withgpg, overriding the setting inmakepkg.conf(5).--nosignโ do not create a signature for the built package.--key <key>โ specify a key to use when signing packages, overriding theGPGKEYsetting inmakepkg.conf(5). if not specified in either location, the default key from the keyring will be used.--noconfirmโ (passed to pacman) prevent pacman from waiting for user input before proceeding with operations. no thoughts, just vibes.--neededโ (passed to pacman) tell pacman not to reinstall a target if it is already up-to-date. (used with-i/--install).--asdepsโ (passed to pacman) install packages as non-explicitly installed (used with-i/--install).--noprogressbarโ (passed to pacman) prevent pacman from displaying a progress bar; useful if you are redirectingmakepkgoutput to file.--packagelistโ list the package filenames that would be produced without building. listed package filenames includePKGDESTandPKGEXT.--printsrcinfoโ generate and print theSRCINFOfile to stdout.
๐ ADDITIONAL FEATURES ๐
makepkg supports building development versions of packages without having to manually update the pkgver in the PKGBUILD. this was formerly done using the separate utility versionpkg. see PKGBUILD(5) for details on how to set up a development PKGBUILD. glow up โจ
๐ REPRODUCIBILITY ๐
makepkg is designed to be compatible with Reproducible Builds. if the SOURCE_DATE_EPOCH environment variable is set, it will be exported to subprocesses, and source and package file modification times and package metadata will be unified based on the timestamp specified. consistent queen ๐
if the SOURCE_DATE_EPOCH environment variable is not set, makepkg will use its own start date for internal use, but will not unify source file timestamps before building.
๐ ENVIRONMENT VARIABLES ๐
bestie, these are the lil knobs you can twist from outside before makepkg even wakes up. they override stuff from makepkg.conf(5), so set them and go ๐
MAKEPKG_LIBRARY="/path/to/directory"โ wanna use a differentlibmakepkginstead of the default/usr/share/makepkg? this is your girl. point it wherever โจPACMANโ the command used to check for missing dependencies and to install/remove packages. it has to support pacman's-Qq,-Rns,-S,-T, and-Uoperations. if it's unset or empty,makepkgjust falls back topacman. simple as ๐ซถMAKEPKG_CONF="/path/to/file"โ use a whole different config file instead of the default/etc/makepkg.conf. iconic behavior honestly ๐MAKEPKG_GIT_CONFIG="/path/to/file"โ an alternate config file for Git instead of the default/etc/makepkg.d/gitconfig. and no cap,makepkgalways stops Git from loading any other config files. it said "my config, my rules" ๐PKGDEST="/path/to/directory"โ where the finished packages go. overrides the matching value inmakepkg.conf(5)๐ฆSRCDEST="/path/to/directory"โ where downloaded sources get stored. overrides the matching value inmakepkg.conf(5)๐ธSRCPKGDEST="/path/to/directory"โ where source package files get stored. overrides the matching value inmakepkg.conf(5)โจLOGDEST="/path/to/directory"โ where generated log files land. overrides the matching value inmakepkg.conf(5)๐PACKAGER="John Doe <john@doe.com>"โ the string that says who made this package. overrides the matching value inmakepkg.conf(5). put your name on it, you earned it ๐BUILDDIR="/path/to/directory"โ where the package actually gets built. overrides the matching value inmakepkg.conf(5)๐ ๏ธCARCH="(i686|x86_64)"โ force a build for one specific architecture. super useful for cross-compiling. overrides the matching value inmakepkg.conf(5)๐ฆPKGEXT=".pkg.tar.gz",SRCEXT=".src.tar.gz"โ sets the compression used when making compiled packages or source packages. overrides the matching values inmakepkg.conf(5)๐๏ธGNUPGHOME="/path/to/directory"โ the directory where the gpg keyring used to sign the built package lives ๐GPGKEY="keyid"โ pick a key to sign packages with, overriding theGPGKEYsetting inmakepkg.conf(5)๐SOURCE_DATE_EPOCH="<date>"โ used for Reproducible Builds โป๏ธBUILDTOOL="<name>"โ the name of a tool ecosystem used to set up the build environment. it's for defining a spec for reproducible builds, like whichmakepkg.conf(5)was used ๐งฐBUILDTOOLVER="<version>"โ the version of the$BUILDTOOLbeing used ๐ขMAKEPKG_LINT_PKGBUILD=0โ setting this to0disables PKGBUILD linting insidemakepkg. lowkey a lifesaver on systems with slow bash subshell operations, or on PKGBUILDs with extreme amounts of package splitting ๐
๐ CONFIGURATION ๐
head over to makepkg.conf(5) for the full tea on configuring makepkg with the makepkg.conf file ๐ซ
๐ ERRORS ๐
when it exits, makepkg returns one of these codes. memorize them or keep this open in another tab, your call bestie ๐ญ
0โ normal exit condition. we love a clean exit โจ1โ unknown cause of failure. mysterious. not in a fun way ๐2โ error in configuration file.3โ user specified an invalid option.4โ error in a user-supplied function inPKGBUILD.5โ failed to create a viable package.6โ a source or auxiliary file specified in thePKGBUILDis missing.7โ thePKGDIRis missing.8โ failed to install dependencies.9โ failed to remove dependencies.10โ user attempted to runmakepkgas root. (we do NOT do that here ๐ซ)11โ user lacks permissions to build or install to a given location.12โ error parsingPKGBUILD.13โ a package has already been built.14โ the package failed to install.15โ programs necessary to runmakepkgare missing.16โ specified GPG key does not exist or failed to sign package.17โ the local repository is not a clone of the source repository specified inPKGBUILD.
๐ SEE ALSO ๐
makepkg.conf(5), PKGBUILD(5), pacman(8)
and fr fr, check the pacman website at https://archlinux.org/pacman/ for the current info on pacman and all its related tools ๐
๐ BUGS ๐
bugs?? bestie be serious, there are NO bugs in this software ๐
but if we happen to be wrong (we're not, but like, hypothetically), report them to the issue tracker at https://gitlab.archlinux.org/pacman/pacman/-/issues with the specifics โ your command-line, the nature of the bug, and even the package database if it helps. receipts, always ๐ซถ
๐ AUTHORS ๐
current maintainers, the ones holding it down rn:
- Allan McRae
<allan@archlinux.org> - Andrew Gregory
<andrew.gregory.8@gmail.com> - Morgan Adamiec
<morganamilo@archlinux.org>
past major contributors, the ogs, the legends:
- Judd Vinet
<jvinet@zeroflux.org> - Aurelien Foret
<aurelien@archlinux.org> - Aaron Griffin
<aaron@archlinux.org> - Dan McGee
<dan@archlinux.org> - Xavier Chantry
<shiningxc@gmail.com> - Nagy Gabor
<ngaba@bibl.u-szeged.hu> - Dave Reisner
<dreisner@archlinux.org> - Eli Schwartz
<eschwartz@archlinux.org>
wanna see everyone who ever contributed? run git shortlog -s on the pacman.git repository. shoutout to the whole group chat ๐๐
and that's the page bestie!! this one's from Pacman 7.1.0, dated 2026-10-15, and it's the MAKEPKG(8) manual โ go build something iconic, and remember: never as root, always with love ๐ซถโจ๐
๐ฆ where this page comes from
- arch rolling: pacman 7.1.0.r9.g54d9411-3 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms