Install packages in Arch Linux from AUR

Arch Linux is a popular Operating System largely because of huge software availability from official repositories and from AUR as well. In this tutorial, we take a look at different ways you can use to install packages in Arch Linux.

Install packages in Arch Linux from AUR

AUR  (Arch User Repository) is a community-driven repository for Arch Linux users. AUR was created with the sole objective of organizing and sharing new packages from the community as well as expediting the inclusion of popular packages in the repository. It comes with package descriptions known as PKGBUILD that allow a user to compile a package from source using the makepkg command and later install it using the native pacman command.

To make things a bit easier, AUR comes with “helpers” or tools that enable you to easily download  PKGBUILD files and invoke the compilation process with only a few steps. This is the easiest and preferred method by ArchLinux users who dislike compiling from source. There are many ‘AUR helpers’ out there but we are going to focus on the 2 major ones.

  1. Yaourt
  2. Packer

Installing packages using Yaourt

Yaourt stands for Yet AnOther User Repository Tool. It’s a package wrapper that users can easily use to install packages from AUR. It’s a wrapper of pacman and comes replete with extended features in addition to AUR support.

How to install Yaourt

We can install Yaourt using the following 2 methods

  1. Using the custom repository
  2. Using AUR

Installing Yaourt using a custom repository

To achieve this, open pacman’s configuration file using your favorite text editor

$ sudo nano /etc/pacman.conf

Next, append the following lines

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

Save the changes and exit.

Finally, update the repository database and install Yaourt using the command below

sudo pacman -Sy yaourt

Installing Yaourt using AUR

This method is a bit longer and a bit tedious. However, if you are still curious, follow the steps below:

    1. First, install the required dependencies as shown
       sudo pacman -S --needed base-devel git wget yajl

      Press ‘Enter’ when prompted to select the default option

    2. Next, query the package query repository to allow you build and run yaourt
      $ git clone https://aur.archlinux.org/package-query.git
    3. Next, navigate to the package-query directory
      cd package-query/
    4. Compile and install it as shown below and exit the directory
      $ makepkg -si
    5. After successful compilation and installation, clone the latest Yaourt repository
      $ git clone https://aur.archlinux.org/yaourt.git
    6. Navigate into yaourt directory
      $ cd yaourt/
    7. Just like we did with package-query , compile and build yaourt using the command below
      makepkg -si

And voila! You have installed Yaourt.

To install packages using Yaourt, the syntax is as follows

yaourt -S packagename

You can update your Arch Linux system by running

yaourt -Syu

To upgrade your installed packages run

yaourt -U packagename

To build a package from PKGBUILD run

yaourt -P directory

Installing packages using Packer

Packer is yet another pacman and AUR wrapper that eases the complexity of manually compiling and installing packages. Like Yaourt, it allows a user to install, upgrade, search and show information about any package.

Installing Packer

First off, install the required dependencies

sudo pacman -S base-devel fakeroot jshon expac git wget

Thereafter, download the PKGBUILD script from AUR using the command below

$ wget https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=packer

For convenience’s sake, rename the folder

$ mv PKGBUILD\?h\=packer PKGBUILD

To compile the downloaded package and create packer installation file run

$ makepkg

Packer’s installation file comes in the form of a tarball. You can verify its existence using

ls

Finally, to install packer run

$ sudo pacman -U packer-*.pkg.tar.xz

That’s it! Packer is finally installed. You can use packer to install, upgrade and display information about installed packages.

To install packages using Packer run

packer -S packagename

You can update all AUR packages by running,

$ packer -Syu

Closing thoughts

That’s all we had for you. In this article, We took you through how you can install packages in Arch Linux using Yaourt and Packer. Keep tuned in for more informative articles. Cheers!

About James

Hey there! This is James, a Linux administrator and a tech enthusiast. I love experimenting with various distributions of Linux and keeping tabs on what's new in the Linux world.
Deploy a managed hourly billed Cloud Server!
Read More