Skip to content

How to Install AUR Packages on Arch Linux with YAY

If you are new with Arch Linux (or Arch Linux based distributions), you may have heard about AUR.

The Arch User Repository (AUR) is a community-driven repository that contains the so called PKGBUILDs, textual package descriptions that allow Arch Linux users to compile packages from source using makepkg and install them with pacman. The Arch User Repository was created to organize and share new packages from the community and to help expedite popular packages’ inclusion into the community repository.

Preparing the System

In order to compile and install an AUR package, you need to install the base-devel package group:

pacman -S --needed base-devel

AUR: The Basic Way

Installing packages from the AUR, using the basic way, is a relatively simple process. Here are the 4 steps to compile and install an AUR package:

  1. Acquire the build files, including the PKGBUILD and possibly other required files, like systemd units and patches (often not the actual code).
  2. Verify that the PKGBUILD and accompanying files are not malicious or untrustworthy.
  3. Run makepkg in the directory where the files are saved. This will download the code, compile it, and package it.
  4. Run pacman -U package_file to install the package onto your system.

AUR Helpers

AUR helpers are tools used to automate the usage of the Arch User Repository. They can search for packages on the AUR,  resolving the dependencies between AUR packages, retrieve and build AUR packages and so on.
Pacman instead, is only able to update pre-built packages in its repositories.

AUR helpers are not supported by Arch Linux, so we need to install them manually.

There are a lot of AUR helpers and they are divided in 3 categories:

  • Search and download
  • Search and build
  • Pacman wrappers

Here you can find some useful comparison tables in order to help you to find the more adeguate option for you.

How to Install and Use YAY

Yay is my favorite AUR helper since it’s easy to use and offer a lot of interesting features. For example, it can resolve every dependency, it can remove the make dependencies at the end of the build process, find matching package providers during search and allow selection, etc.

Before the installation, make sure you have the base-devel package group installed, as said before.

pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

Here is a list of useful commands for using Yay:

yay <Search Term> – Present package-installation selection menu.
yay -Ps – Print system statistics.
yay -Yc – Clean unneeded dependencies.
yay -G <AUR Package> – Download PKGBUILD from ABS or AUR.
yay -Syu --devel – Perform system upgrade, but also check for development package updates.
yay -Syu --timeupdate – Perform system upgrade and use PKGBUILD modification time (not version number) to determine update.
yay -Wv <AUR Package> – Vote for package (Requires setting AUR_USER and AUR_PASSWORD environment variables). (yay v12+)
yay -Wu <AUR Package> – Unvote for package (Requires setting AUR_USER and AUR_PASSWORD environment variables) (yay v12+)

Final Words

In my opinion, Yay is one of the best ways to install and manage AUR packages. AUR packages can extend your Arch Linux experience enabling you to install hundred of packages like Chrome and Spotify in an easy way.

If you need more informations about Yay, feel free to visit the official GitHub page.

Published inUncategorized

Comments are closed.