Select your language

PKGBUILD files are how packages are built and created for Arch Linux and its derivatives such as Manjaro.

You may have even come across them a bit yourself if you’ve ever used the AUR, Arch Linux’s user-curated repository of PKGBUILDs.

But how exactly do you go from a PKGBUILD to an installable package? What exactly is going on between the two, and how can you make them for your own packages? You’ll learn them in this article.

PKGBUILD basics

For those who are familiar with Bash or other shells, you’ll be delighted to know, if you didn’t already, that a PKGBUILD is pretty much just a shell script with some variables.

PKGBUILD files consist of variables and functions, all of which are used to define the package itself, and how to build it.

To create a package from a PKGBUILD, the makepkg command line utility is used. After obtaining a PKGBUILD, you simply run makepkg inside the directory containing the PKGBUILD, and voila, you have an installable package!