One of the cool things about Arch linux is the Arch User Repository (AUR), where users can add their favourite packages to Arch. Because there is a liability, AUR packages cannot be installed by Pacman automatically, but should be downloaded, checked and installed manually. Often, you’ll have good reason to assume that the package is fine, and a superficial check is sufficient. Yaourt is an installer that can be used instead of or in addition to Pacman, and which also allows easy install of AUR packages. In theory, therefore, you’ll need to manually install only two AUR packages: Yaourt and its dependency package-query. Here’s how to do that.
Yaourt needs package-query to build and run, so we must install that first, after which we can install Yaourt. Before you start, you should make sure that the packages/package groups wget, base-devel and yajl are installed (from the official Arch repo):
$ sudo pacman -S --needed wget base-devel yajl # install if necessary
I use the directory ~/temp/AUR/ to manually install AUR packages:
$ mkdir -p ~/temp/AUR/ && cd ~/temp/AUR/
First, we install package-query…
$ wget https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz # download source tarball $ tar xfz package-query.tar.gz # unpack tarball $ cd package-query && makepkg # cd and create package from source $ sudo pacman -U package-query*.pkg.tar.xz # install package - need root privileges
…and then Yaourt in the same way:
$ wget https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz $ tar xzf yaourt.tar.gz $ cd yaourt && makepkg $ sudo pacman -U yaourt*.pkg.tar.xz
That should be all — enjoy Yaourt! Note that you run Yaourt as a normal user, without sudo. sudo will be called (and you will be asked for your user password) after the package has been compiled, and before it is installed into your live system.
PS, don’t forget to install aurvote (yaourt aurvote) to vote for your favourite AUR packages after installing them!
Upgrade to pacman 5
When you need to upgrade pacman to version 5, you may find the following error:
package-query: requires pacman<4.3
The solution is to uninstall package-query, upgrade pacman, and manually reinstall package-query:
$ sudo pacman -Rdd package-query # Remove package-query $ sudo pacman -S pacman # Upgrade pacman
Then reinstall package-query manually as described above.