Installing Yaourt on Arch linux

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 ~/tempAUR/ to manually install AUR packages:

$ mkdir -p ~/tempAUR/ && cd ~/tempAUR/

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
$ cd -

…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
$ cd -

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!  Also, if everything works, you can remove the ~/tempAur/ directory.


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.


See also: Colourised package manager for Arch Linux

This entry was posted in All, Software and tagged , , , , . Bookmark the permalink.

8 Responses to Installing Yaourt on Arch linux

  1. Florian says:

    Thanks for this great tutorial! After archlinux.fr was missing dependencies, this is the best solution!
    Just a small note: I had to install yajl on my new arch linux distro

  2. Marcell says:

    Hello, I receive the error ==> ERROR: Running makepkg as root is not allowed as it can cause permanent, catastrophic damage to your system.

    How can I fix this I am using arch linux arm on raspberry pi, newest release.

    Thanks
    Marcell

    • AstroFloyd says:

      Run all the commands above from your user account, not your superuser/root account. If you don’t have a user account yet, create one by doing something like

      # useradd -m -g users -G wheel -s /bin/bash <username>
      # passwd <username>

      See # man useradd for more info.

  3. AstroFloyd says:

    Updated download urls to the new AUR

  4. daily4x4 says:

    I get the response ” wget: command not found”

  5. I don’t know why, but in Arch Wiki isn’t published the official method.

    Great article. Works great. Thanks!

  6. Ben Noff says:

    Thank you, worked perfect.

Leave a comment