How to Install and Make Use of Yay Program on Arch Linux

We independently review everything we recommend. When you buy through our links, we may earn a commission.

How to Install Use Yay Arch Linux

You are able to retrieve and install Arch User Repository packages with the assistance of an AUR tool such as yay. The following is an installation guide for yay on Arch Linux.

Pacman is a strong package manager that is used by Arch-based distributions as the default, however it does not have the capability of obtaining packages from the Arch User Repository (AUR). The AUR (Archive of User-Maintained Software) is a repository that is maintained by the community and offers thousands of third-party packages in the form of installation scripts that are also known as PKGBUILDs.

It is necessary for us to have an AUR helper such as yay in order to install packages by utilizing these PKGBUILDs. yay is neither a component that is pre-installed on Arch Linux, nor is it a component that can be obtained from the official Arch repository. So how exactly do you install yay on your Arch desktop so that you may get packages from the AUR? Let’s find out.

What is the procedure for yay installation on Arch Linux

The only place you can get the yes package is through the Arch User Repository. You should be aware that you can install packages from the AUR manually without using an AUR helper (similar to how we’ll install yay below), but as the name suggests, a “AUR helper” assists you in the installation process, making it simpler for you to install packages with minimal user interaction. Note that you can install packages manually from the AUR without using an AUR helper.

You will first need to obtain the necessary requirements in order to install yay on your Arch desktop:

sudo pacman -S –needed base-devel git

After that, make a copy of the Yay repository by using the git clone command:

git clone https://aur.archlinux.org/yay.git

Using the cd command, move your current working directory to the folder labeled yay that was just just downloaded:

cd yay

In the end, the makepkg command should be used to construct and install yay:

makepkg -si

That you execute the command above and receive the error message “cant locate the fakeroot binary,” check to see if the base-devel package was successfully installed, and then try running the command again.

note
This approach is applicable to various Arch-based distributions in addition to Arch Linux. Some examples of these distributions are Manjaro, EndeavourOS, and Garuda Linux.

When you are finished, confirm if the installation was successful by examining the version of yay that was installed.

yay –version

You will know that the installation of yay was successful if the output returns a version number.

The Arch User Repository, or AUR, was not initially developed to be utilized on Linux distributions other than Arch Linux and its variants (like Ubuntu and Linux Mint). You are able to use Pacstall, an AUR-inspired package manager that offers pacscripts for installing applications, on these distributions. Pacstall is available.

How to Use yay to Manage Packages from the AUR

The yes command and the Pacman command share a number of similarities. For instance, if you want to install a new package using Pacman or yay, you would use the -S flag. On the other hand, if you want to uninstall a package, you would use the -R option.

Now that you are aware of the similarities between the two package managers, let’s start with the package management using yay on Arch Linux.

Looking for AUR Packages

Yay is an alternative to Pacman that gives users the ability to search for packages before installing them. In the event that you are unclear about the name of a specific package, you may use the yay command in conjunction with the search phrase to locate other packages that are similar.

yay searchterm

For instance, to look for packages whose names contain the word “chrome,” you could:

yay chrome

Output:

Make advantage of the -Ss switch to do a search for a package in both the official repositories and the AUR:

yay -Ss google-chrome

In addition, you have the option of specifying additional keywords in order to do a search that is more specific and restricted.

yay -S term1 term2

The command that was just described will begin by looking for term1, and then it will proceed to narrow down the results by looking for term2 among the ones that were returned.

Installing Programs Using The yay Command

As was previously said, in order to install packages using yay, you only need to give the package name next to the -S flag:

yay -S packagename

Installing the Google Chrome AUR package using yay requires the following steps:

yay -S google-chrome

note
The installation procedure is not entirely hands-off, and there is a possibility that you may be prompted to provide your superuser password at some point throughout the process.

Use either the -G or the —getpkgbuild flag to obtain a package’s PKGBUILD in its entirety:

yay -G google-chrome

You also have the option of printing the PKGBUILD by combining the -p flag with the -G: option.

yay -Gp google-chrome

Output:

Removing Packages With yay

Use the -R option to uninstall an AUR package from your system when you no longer require it.

yay -R packagename

To uninstall Google Chrome:

yay -R google-chrome

If you wish to delete the package’s dependencies as well, use the -ns flag:

yay -Rns google-chrome

Installing the Latest AUR Version

A full system upgrade will be performed in a manner analogous to that of the pacman -Syu command if the yes command is invoked without any parameters. It is important to take note that in addition to the AUR, this operation will also synchronize and upgrade any packages that are located in official repositories.

Use the -Sua parameter in conjunction with the command to restrict the update to only the AUR packages:

yay -Sua

To prevent Arch Linux from automatically updating packages, you will need to edit the configuration file, which can be found in the /etc/pacman.conf directory. If you so want, Linux also enables you to roll back the version of software packages currently installed on your computer.

Making Use of yay to Get Rid of Unneeded Dependencies

If you don’t take care of them, unused dependencies can quickly accumulate and use up a significant portion of your system storage if you don’t delete them. You have the option of removing the dependencies along with the packages by using the -Rns flag each time you remove something, or you can take the more efficient route of removing them all at once by using the -Yc flag. Either way, you have two options. You can choose to remove the dependencies along with the packages, or you can choose to remove them all at once.

yay -Yc

The -Y parameter in the command stands for the word “yay,” and it restricts the program’s actions to only those packages that were installed using yay.

Additional commands for yay

Execute the following command to have yay publish package statistics as well as the health of the system:

yay -Ps

Output:

In the event that you have questions regarding the commands, you may quickly obtain command-line assistance by using the —help flag:

yay –help

You also have the option of seeing the entire manual page by utilizing:

man yay

The AUR Provides for All of Your Requirements!

Go check out the AUR and look for software that you’ve always wanted to install on Linux. Now that you’ve mastered the process of installing AUR packages, it should be a snap for you. There is a reasonable possibility that it will be accessible through the repository.

Keep in mind that there is a potential danger to your security if you use the AUR. Considering that anybody may upload their PKGBUILD to the AUR, it’s not very common for these installation scripts to be adequately tested and evaluated. Nevertheless, this does not imply that you should completely refrain from getting packages from the AUR.

Instead, reduce the likelihood of negative outcomes by going through the PKGBUILDs before installing the packages. This will not only keep your system secure, but you will also get an understanding of how packages in the AUR function.

Alex
We will be happy to hear your thoughts

Leave a reply

TopBestProductReview
Logo