Instantly, install Yay via the following pacman or pamac commands.
$ sudo pacman -S yay
#OR
$ sudo pamac install yay
However, I advise you to read the entire article in order to gain a deeper understanding, which includes valuable tips on handling packages from AUR using Yay.
Yay (Yet Another Yaourt) is a popular Arch User Repository (AUR) helper for Arch Linux and its derivatives, such as Manjaro, after the discontinuation of Yaourt and Packer.
It is a command-line utility that simplifies the process of searching, installing, and managing packages from both the official repositories and the AUR.
If you donβt know about AUR, In a nutshell, itβs a community-driven repository that contains user-contributed package build scripts. This script allows users to install packages that are not available in the official Arch repositories.
In this article, you will learn how to install Yay on your Arch-based systems, how to use it (with practical examples), and when not to use it.
Tutorial Details
Description | Yay (AUR Helper) |
Difficulty Level | Moderate |
Root or Sudo Privileges | Yes |
OS Compatibility | Arch, Manjaro, EndeavourOS, etc. |
Prerequisites | β |
Internet Required | Yes |
How to Install Yay (AUR Helper) on Arch-Based Systems
Here are the steps to install Yay (the AUR helper) on your Arch-based systems:
1. Open your terminal, refresh the package cache, and update the system by using the pacman command:
$ sudo pacman -Syu
2. Install βgit
β (required to clone the Yay git repository) and βbase-devel
β (install essential development tools and libraries for building AUR packages).
$ sudo pacman -S --needed git base-devel
When using the β--needed
β flag, it wonβt reinstall packages that are already installed.
3. Now, use the git command to clone the Yay repository from the AUR in your current directory:
$ git clone https://aur.archlinux.org/yay.git
4. Once done, switch to the cloned Yay directory using the cd command:
$ cd yay
5. Lastly, build and install Yay using the βmakepkg
β utility.
$ makepkg -si
The β-s
β flag is used to automatically resolve and install required Yay dependencies, and the β-i
β flag is used to install the package once itβs built.
6. After the installation is successfully completed, you can delete the Yay directory using the following command:
$ cd .. && rm -rf yay
7. Ensure the βyay
β command is accessible from the terminal by checking its version information using the following command:
$ yay --version
Output:
How to Use Yay in Arch Linux and Manjaro
Once Yay is installed, you can simplify the process of searching, installing, and managing the packages from the AUR repositories. Here are some examples of how to use βyay
β:
Update System and Packages
When you issue the βyay
β command without specifying any flags, it will automatically consider using the βyay -Syu
β command used to update your Arch Linux system. Itβs also equivalent to the βpacman -Syu
β command:
$ yay
#OR
$ yay -Syu
After issuing the above command, it will update the systemβs package database and upgrade the installed packages.
Update AUR Packages Only
The previously mentioned command will also upgrade the packages installed by Pacman and Yay. If you only want to upgrade packages installed from Yay, run:
$ yay -Sua
Check for Updates
To check for available updates for all installed packages from the βyay
β command without upgrading them, you can use the following command:
$ yay -Qua
Or use the βyay -Qu
β command to include the pending package update information installed from official repositories.
Search for a Package
To search for a package in the official repositories or AUR repository, you can use the βyay
β command followed by the package name (e.g., βfirefox
β):
yay firefox
β command, it will list the matched packages and allow you to select packages to install.$ yay firefox
#OR
$ yay -Ss firefox
Install a Package
To install a package from the official repositories or AUR repository, you can use the βyay
β command with the β-S
β flag followed by the package name (e.g., βneofetch
β):
$ yay -S neofetch
Print Package Information
To print the installed or uninstalled package information from the official repositories or AUR, you can use the βyay
β command with the β-Si
β flag followed by the package name (e.g., βneofetch
β):
$ yay -Si neofetch
Remove a Package
To remove a package, you can use the β-R
β flag with the βyay
β command followed by the installed package name (e.g., βneofetch
β):
$ yay -R neofetch
Clean Package Cache
To clean the package cache and remove the old, unwanted dependencies and leftover packages, run:
$ yay -Sc
Print the System Statistics
To check the list of total installed packages, including foreign and explicitly installed packages, the total size occupied by the installed packages, and the total size of the Pacman and Yay caches, run:
$ yay -Ps
When Not to Use Yay or AUR Packages
AUR packages are entirely user-contributed, and while many maintainers are careful, some packages might not be thoroughly reviewed for security issues. Before installing any package from the AUR, you should review the PKGBUILD file (the build script for the package) and inspect the code to ensure its safety.
And most of the packages can be updated frequently, but not all maintainers follow the same update standards as the official repositories. So, installing updates from the AUR might introduce instability or compatibility issues with other system packages. Itβs a good practice to be cautious and only update AUR packages when necessary.
If you have multiple AUR helpers installed on your system, then they might conflict while installing and managing the packages. So, stick to using a single AUR helper to avoid potential issues.
While using AUR helpers like βyay
β can automate certain tasks,Β it might also take away some of the details of package management. If you want more control over the installation process or want to be directly involved in package building, you can choose to manually install AUR packages.
How to Remove Yay (AUR Helper) from Arch-Based Systems
If you do not want to have Yay any more for any reason, you can use the following command to remove it from your Arch-based systems:
$ sudo pacman -Rs yay
Yay is just a helper to automate the process of downloading, building, and installing packages from the AUR. If you remove βyay
β from your system, the packages that were installed from AUR repositories using βyay
β will remain on your system.
So, if you remove βyay
β, the packages it installed will stay on your system until you explicitly uninstall them using the Pacman package manager. To remove an AUR package without βyay
β, use βpacman -Rs
β followed by the package name.
Final Word
I hope you find this article useful. If you have any questions or queries related to this article, then feel free to ask them in the comment section.
Till then, peace!
Join The Conversation
Users are always welcome to leave comments about the articles, whether they are questions, comments, constructive criticism, old information, or notices of typos. Please keep in mind that all comments are moderated according to our comment policy.