Which AUR helper? Use Yay!
One of the strongest points of Arch Linux is the huge amount of packages available in the Arch User Repository (AUR). There are also many AUR helpers that make using the AUR really simple. In this post, you will learn how to install and use Yay, perhaps the best AUR helper.
- Yay is probably the best AUR helper
- Install Yay in Arch Linux
- How to use Yay
- More information about Yay and AUR helpers
In Arch Linux, the AUR helpers are perhaps the most distinctive element of the distribution. Although they are not officially part of the distribution, they automate the installation of packages from the AUR (Arch User Repository). This makes unofficial applications like Spotify quite easy to install. AUR helpers enable searching, installing and removing packages from the AUR as if they were in the official repositories. Thus reducing manual compilation times that delay our productivity.
Perhaps the most popular AUR helpers have been Yaourt and Aurman, but they are currently discontinued and not recommended for use. But do not worry, Yay is here to save you.
Yay is probably the best AUR helper
Yay is an AUR helper written in the GO programming language. It is quite fast when searching for packages in the AUR repositories. Besides, it requires minimal dependencies. An almost distinctive element of Yay is that it allows autocompletion and colored output making it easier to read.
So, let us install it.
Install Yay in Arch Linux
First of all, to install Yay on Arch Linux, you need to have
git packages installed:
1 sudo pacman -S --needed base-devel git
When the installer asks you which packages to install, press the Enter key and install all the recommended dependencies.
git to download the source code of Yay:
1 git clone https://aur.archlinux.org/yay.git
I recommend running this command in a dedicated folder. For example, I created the folder
~/Programs and do the compilation and installation of the AUR programs from there. Also, if you are curious, I got this git link from Yay page in the AUR.
When you run the above command, a folder called
yay will be created. Enter this folder using the
1 cd yay
In the yay folder, there is a file called PKGBUILD that contains all the installation instructions for yay. You can check its content:
1 less PKGBUILD
Note: to exit the less program, press the Q key
If everything is fine, start the compilation and installation:
1 makepkg -si
During the process you will have to enter the password:
Hopefully, the compiling and installation will finish without errors and you will get Yay installed.
How to use Yay
Yay is very simple and easy to use. In many cases, the syntax is very similar to the Pacman syntax, so there is no need to learn new things.
Let us take a look.
Search for a package
Yay can search for a package in both standard and AUR repositories. To search for a package just use the following command:
1 yay -Ss package_name
For example, if I search for
libreoffice, Yay gives the results for all available repositories including AUR, extra or community:
Search and Install a package
It is also simple and practical to use Yay for search and subsequent install of a package. For example, if you use the command
yay followed by the package name without any option, it will show you all available packages and offer you an option to install it. As an example, I will use Spotify which is a very popular program that is not in the official Arch Linux repositories:
As you can see from the image, Yay searches for the
spotify package. And if you choose the option 2, Yay will also compile and install it.
Install a package without search
If you know the exact name of the package you want to install then you do not need to do a search first. In this case, Yay can install it with the same Pacman syntax:
1 yay -S package_name
If the package has more than one supplier, you will be asked to choose one.
Upgrading all the installed packages with Yay
Finally, if you need to update all the packages including the AUR packages, you can use Yay for that. Again, it is the same syntax as in the Pacman:
1 yay -Suy
Yay will install all the packages from the official repository as well as it will compile and install packages from the AUR which is a pretty good solution because you can update your whole system just with one command.
Remove a package
In case you want to uninstall an AUR package, you can do it the same way as with Pacman. That is, using the
-R option. However, you can add the
ns options to remove unnecessary dependencies as well:
1 yay -Rns package_name
You can also remove an installed AUR program and its dependencies with Pacman:
1 pacman -Rns package_name
Remove the orphaned packages with Yay
As you install and uninstall packages, it is possible that there will be some orphaned dependencies. You can search and remove them as follows:
1 yay -Yc
This way you will be able to have your Arch Linux cleaner. To clean your system more, you can follow my guide on how to clean Arch Linux.
More information about Yay and AUR helpers
Yay has many more options than I have presented. If you want more information about Yay, you can get it from Yay man page:
1 man yay
Yay is a great AUR helper that stands out for being fast, flexible and having a syntax very similar to Pacman. I recommend using it because it is the most popular AUR helpers after Yaourt and Aurman are discontinued. Yay is also handy because you will be able to update all the packages installed in your system regardless of their source repository.