Install a package from AUR on arch linux

The easiest way to install packages on arch Linux is from the official repositories using pacman. This is also the preferred way since the packages installed this way are updated through system-wide updates.

However – what if the package you need is not available in the official repos? Or perhaps you need a newer version? In this case you can follow this procedure:

1. Look it up on AUR

AUR stands for arch user repository. It is maintained by the community. Many packages are availible. AUR.

2. Check it

Check the dependencies. You will need to install them later if they are not installed on your system but no need to worry about that just yet. Read the discussion on the bottom of the page – it sometimes contains valuable info. If the package is flagged out of date you can consider yourself unlucky. These ones usually don’t work out of the box. Try – perhaps it does. Many packages are marked with “-git”. These ones use git to install the newest version of the software.

3. Download and untar

Download tarball archive using your browser. It is worthwhile using a special folder for all the programs you build for convenience. Once downloaded locate the file through console and run:

tar -zxvf package_name.tar.gz

cd package_name

4. Read the PKGBUILD file and build

PKGBUILD file contains all the information needed to install a package. You are advised to see it before install but it is not necessary.

Then run this command:

makepkg -src

s (syncdeps) installs the missing depencenies using pacman provided they are available through sync repos. In case they are not you can install them the way you are trying to install this one.

r (rmdeps) removes the dependencies after the build process is completed so your system does not get loaded with programs you do not need.

c (clean) cleans up leftover work files used during the build process.

In case build process was not not successful you can try to edit PKGBUILD file, leave a comment on the package AUR website or perhaps send a message to the mantainer.

5. Install using pacman

After a successful build process your current folder should contain a file with the extension .tar.xz. Install the package like this (as root):

sudo pacman -U *.tar.xz

U (upgrade) upgrades or adds package(s) to the system and installs the required dependencies from sync repos.

6. Mantain

You should treat your system well. Info regarding the arch linux maintenance is availible through the arch wiki.