How to Install Yay (AUR helper) on Arch Linux

Arch User Repository is a community-driven repository for Arch users, and packages are distributed in the form of PKGBUILD. Since the packages are in PKGBUILD form, you can not install them with Pacman. So, to install packages from AUR, you will need to perform a manual build to install the package or use an AUR helper to automate the package installation.
Yay (Yet Another Yogurt) – An AUR Helper Written in Go for Arch Linux distributions. The AUR helpers help to automate the usage of the Arch User Repository in the like searching packages published on the AUR, resolving dependencies, downloading, and building AUR packages.
Install Yay on Arch Linux
Install Yay from Source
First, install git and development tools to install Yay on Arch Linux as the root user.
pacman -Sy --needed git base-devel
Then, download the AUR package with the git
command.
git clone https://aur.archlinux.org/yay.git
And then, go to the downloaded directory.
cd yay
Finally, build the Yay AUR helper with the below command.
makepkg -si
Install Yay Using Binary
First, install git and development tools to install Yay on Arch Linux as the root user.
pacman -Sy --needed git base-devel
Then, download the AUR package with the git
command.
git clone https://aur.archlinux.org/yay-bin.git
And then, go to the downloaded directory.
cd yay-bin
Finally, build the Yay AUR helper with the below command.
makepkg -si
How to use Yay on Arch Linux
The Yay AUR helper is similar to Pacman, and you will not find any difficulty in using it for installing packages from AUR.
yay -Sy <package_name>
Install a package from AUR after synchronizing a remote repository
yay <package_name>
Package search with the installation menu
yay -Si <package_name>
View the package information
yay -R <package_name>
Remove an installed package
yay -Q
List the locally installed packages
yay -Q <package_name>
Search for an installed package
yay -Qi <package_name>
View the installed package’s information
yay
Alias to yay -Syu
. Perform system upgrade
yay -Ps
Print system statistics like Yay version, statistics of installed packages
yay -Yc
Clean unneeded dependencies
yay -Y --gendb
Generate the package database of AUR packages that you installed without yay
AUR helper
yay -Syu --devel
Perform system upgrades, including AUR packages
yay -Y --devel --save
Enable AUR package updates permanently. yay
or yay -Syu
will update AUR packages as well during the system upgrade.
man yay
Read Yay’s official manual.
Conclusion
That’s All. I hope you have learned how to install Yay on Arch Linux and Yay AUR helper usage basics. You can also visit Yay’s official website for more information.