How to Install AUR Packages on Arch Linux?
Arch Linux is one of those distributions that work over the rolling release model. You can access different software using its official pacman package manager tool. Pacman lets you install software easily from the official repositories. But what if you want to install software that is missing from the official Arch Linux repositories? Luckily, Arch Linux has a solution for that too. It’s called the Arch User Repository (AUR).
The AUR is a user repository where other Arch Linux users share their software packages. Here you will find several packages to install. But the main question is how do you install software from the AUR? For that, you need a helper tool that does the work for you. The AUR helper can download, build, and install the AUR packages on your system. That’s how you can use the AUR to get more software for your Arch Linux.
Follow this article to learn different ways of installing AUR packages on your Arch Linux system.
What is AUR and AUR Helper?
AUR is the acronym for Arch User Repository. It is a collection of user-submitted package description files (PKGBUILD). These package description files can be used to create and install software packages on Arch Linux and its sub-distributions. The Arch Linux distros have no official support for the AUR packages. So you need to be careful when you install the PKGBUILD scripts from unknown sources.
You can use a tool called an AUR helper to make it easier. An AUR helper can find, download, build, and install packages from the AUR for you. It can also update them when there are new versions. There are many AUR helpers you can choose from, such as yay, aurman, Pamac, and others. You don’t need an AUR helper to use the AUR, but it can save you some time and hassle.
Let’s cover some ways of installing AUR packages in the Arch Linux system.
How to Install Packages From AUR on Arch Linux
To install packages, you can either directly download them by getting their Git Clone URL or install them with the help of AUR helper. However, if you are a GUI person there is an alternative way to install using the pamac package management utility. Pamac also supports installing packages from the AUR, Flatpak, and Snap. You can install Pamac on Arch Linux by using an AUR helper or by adding the Chaotic-AUR repository.
Note that the pacman is the only package manager that comes by default with the Arch Linux system. But, it doesn’t have support to directly install packages from the AUR. Now we will cover three different ways of installing AUR on Arch Linux.
1. Install AUR Packages Using yay
The yay is an AUR helper for managing packages on Arch Linux and its variants. It is a command line tool that lets you install, update, and remove software from the Arch User Repository (AUR). You can also use yay to install packages from other sources, such as Flatpak and Snap. The AUR helper yay is similar to Pacman, but it has some extra features and options.
Let’s check out the steps to install yay on Arch Linux.
Installing yay on Arch Linux
To install Yay, you need to clone its git repository from the AUR and build it with the makepkg command.
Start by installing the git in your system. It is a version control system, with the help of which you can clone repositories from the internet, such as the AUR.
First, download the git package:
sudo pacman -S git
Next, download some important dependencies.
sudo pacman -S –needed base-devel git
This command installs the base-devel group of packages. These packages have essential tools for building software from source, such as compilers, make, and patch. The –needed option checks for duplicate packages.
Now, clone the git repository using the following command:
git clone https://aur.archlinux.org/yay.git
This command clones the yay repository from the AUR to your local machine. This creates a directory called yay in your current working directory. Inside the yay directory, you can find all the files that are needed to build and install yay.
In the above command, the git clone is followed by the AUR package git URL. You can get this URL from the official Arch Linux user repository. Search for the specific AUR package using the search bar.
After selecting the name of the AUR package, the following window will open. Here you can copy the Git Clone URL.
After cloning the yay repository now change your current working directory to the yay directory that you just cloned.
cd yay
Once you are inside the yay directory, use the makepkg command to build yay from the source files. The makepkg command is a script that automates the software compiling and packing.
makepkg -si
You will need to enter the password several times while the build process is running.
The -s option tells makepkg to install any missing dependencies for yay using pacman. The -i option tells makepkg to install the resulting package after building it.
Once the yay is successfully installed, you can check its version using the below command:
yay –version
Now yay is successfully installed on Arch Linux using the AUR repository.
Searching an AUR Package Using yay on Arch Linux
After installing yay, you can use it to search for an AUR package or install and update it. Using yay you can also remove the AUR packages.
To search for packages with a keyword, use the yay command followed by the package keyword you are looking for. For example, to search for packages with chrome in their name, use:
yay chrome
It will list all the instances where the chrome keyword is present.
Multiple keyword search is also possible. It will further narrow down your search results. For multiple keywords, add a space between two consecutive keywords:
yay keyword1 keyword2
For example, if you want to search for all the Google Chrome available packages, run:
yay google chrome
You can also use the -Ss flag to search for any package in both the official repositories and AUR:
yay -Ss google-chrome
Installing an AUR Package Using yay on Arch Linux
To install a package, use the -S option and specify the package name:
yay -S package_name
For example, to install google-chrome from the AUR, use:
yay -S google-chrome
Type y to proceed with Google Chrome installation using the AUR package.
Chrome is installed on your system using AUR helper, yay.
Note: You will be prompted to enter a password during the installation, otherwise it won’t finish.
If you want to install packages without user confirmation, run:
yay -S –noconfirm package_name
For example:
yay -S –noconfirm google-chrome
If you want to download only the PKGBUILD file of a package, you can use the -G or –getpkgbuild option.
yay -G google-chrome
To print the PKGBUILD file, add -p flag with -G:
yay -Gp google-chrome
Removing an AUR Package Using yay on Arch Linux
To remove the AUR package and its dependencies, you can use the following syntax:
yay -R package_name
For example, to remove google-chrome AUR package using the yay, run:
yay -R google-chrome
To completely remove a package along with its associated dependencies, run:
yay -Rns google-chrome
Updating AUR Packages Using yay on Arch Linux
To update your system and the AUR packages, use:
yay
To update only the AUR packages, use:
yay -Sua
It will show you the differences between the current and new PKGBUILD and allow you to edit them.
To print the available AUR updates, use:
yay -Qua
Currently, there are no updates available, so we have no response.
2. Manually Install AUR Packages on Arch Linux
If you have decided to go with the manual route, then it’s easy to install AUR packages without any AUR helper. The process is similar to what we did in the above steps to install yay directly from AUR. Follow the given steps to grab the AUR packages manually.
First start with getting the Git Clone URL. For that, visit the official Arch Linux user repository. Go to the package page, search for the required package, and click over it.
Now copy the URL. This is the URL of the git repository that contains the source code and the PKGBUILD file of the package you want to install.
Now run the git clone command, followed by the package git clone URL.
git clone https://aur.archlinux.org/google-chrome.git
This command will clone the git repository to your local machine.
A new directory named google-chrome will be created in your current working directory.
Now run the below command to change your current working directory to the google-chrome directory that you just cloned.
cd google-chrome
Now build and install the package using the PKGBUILD file.
makepkg -si
Here in this command, the -s option will automatically resolve and install the dependencies. The -i option will install the package after building it. You may be required to authenticate by entering the root password.
Google Chrome AUR package is successfully installed.
Now you can use the pacman to remove the Google Chrome AUR package.
First, find the name of the package by using the pacman:
pacman -Qs google-chrome
Next, use the -Rns flag with the pacman command followed by the package-name to remove the package and its dependencies.
sudo pacman -Rns google-chrome
Optionally, you can also delete the directory where you cloned the git repository of Google Chrome AUR package.
rm -rf ~/google-chrome
3. Install AUR Packages Using GUI on Arch Linux
If you are the type of person who prefers a graphical interface, then luckily it’s also possible to install the AUR packages using the pamac package manager.
Pamac is a package manager based on libalpm. It has support for Appstream, AUR, Flatpak, and Snaps. Pamac is an alternative to pacman, with an easy-to-use interface.
To install pamac, you need to use a command-line tool called yay. Open a terminal and run:
yay -S pamac-aur
Wait for the installation to finish and then close the terminal.
Open your App menu and look for the Add/Remove Software application. You can also search for the pamac, and it will show up.
Open the application and click on the hamburger icon in the top right corner. Then, go to the Preferences section.
Enter the root password.
In the Third Party tab, enable the AUR support by toggling the switch.
Now using the pamac interface you can search and install any AUR packages. You have successfully enabled AUR support on your system.
Using Other AUR Helpers
There are several other AUR helpers available, such as Paru, Pacaur, and Trizen. Each helper has its own installation and usage process. You can select the best according to your system and needs.
Paru: Written in Rust, Paru is a fork of Yay that offers some improvements such as better performance, less memory usage, and more customization options. It can also edit PKGBUILDs in Vim before installing.
Pacaur: Written in Bash, Pacaur is a minimalist helper that aims to be fast and simple. It supports most of the Pacman operations and it has a reliable dependency solver. It also has a different view and a file review feature.
Trizen: Written in Perl, Trizen is a lightweight helper that has a recursive search feature and a customizable interface. It can also handle split packages and complex dependency chains.
Conclusion
This article covers multiple ways to install packages in Arch Linux from the AUR. By default, Arch Linux uses the pacman package manager. However, this default package manager lacks a lot of applications and tools. AUR is the best alternative to pacman. But for that, you need an AUR helper, or you have to directly clone the AUR packages in your system, and later build them manually.
You can use the yay, which is an AUR helper. It can easily install any of the AUR packages from CLI. The yay makes it possible to access software that is missing on default Arch Linux repositories. However, if you prefer GUI interfaces, then you can also install the pamac package manager tool. This will help you to easily search and install AUR packages using an easy-to-use interface.


















