Install and Use Yay on Arch Linux

Yay is one of the most popular AUR helper for dealing with packages from Arch User Repository. Learn to install it in Arch Linux.
Warp Terminal

You'll find a huge number of software packaged by the community members in Arch User Repository (AUR).

Since it is coming from third parties, purists suggest downloading and building each desired package from AUR manually.

But that's a tedious task and that's why AUR helpers were created to save the trouble.

Yay is one of the most popular AUR helpers and in this tutorial, I'll share how you can install Yay on Arch Linux. I'll also share a few tips on managing packages from AUR with Yay.

πŸ’‘
Yay is available in Manjaro's repository. So, Manjaro users can simply use pacman -S yay to install

Installing Yay on Arch Linux

Before you go on with Yay installation, you need some packages required to build it.

Let me divide it into steps.

Step 1: Install the prerequisite packages

It is always a good idea to refresh the package cache and update the system first:

sudo pacman -Syu

Install the rerquired base-devel (contains tools such as makepkg etc) and git (required for cloning the yay git repository).

sudo pacman -S --needed base-devel git

With the --needed flag, it will NOT reinstall the already installed packages.

Here's what it looks like:

Now that you have the required packages, it's time to get Yay on your system.

Step 2: Clone the Yay git repo and switch to it

Use the git command to 'clone' the Yay repo. You can do it anywhere in the system, be it your home directory or otherwise.

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

Once done, switch to the cloned directory:

cd yay
Clone yay git repo

It's time to install yay (finally).

Clone yay Git

Step 3: Install yay

Actually, you are building it. You'll see a PKGBUILD file here. Use the following command to build the package from here:

makepkg -si

Follow the on-screen instructions. Press Y when you are asked to confirm.

Build yay package in arch Linux

Once the process finishes, verify that yay has been installed successfully by checking its version.

yay --version

Now that you have successfully installed it, you may remove the cloned Yay git repository. It is not needed anymore.

Install Yay
Proton Mail: Get a private, secure, and encrypted email account | Proton
Proton Mail is the world’s largest secure email service with over 100 million users. Available on Web, iOS, Android, and desktop. Protected by Swiss privacy law.

Using Yay for package management

The yay follows similar (but not identical) command structure as pacman. So it should not be difficult for you to manage AUR packages with Yay.

Search for packages with:

yay search_term

Install the packages with:

yay -S package_name

Remove packages with:

yay -R package_name

To delete a package with its dependencies:

yay -Rns package_name

Upgrading (only) the AUR packages:

yay -Sua
Updating Yay on Arch Linux
πŸ’‘
Yay is also capable of upgrading non-AUR packages. The a flag in yay -Sua restricts it to AUR packages only.

Also, it is recommended to not use sudo with yay. You'll be asked to enter the account password when it actually starts to install a package on your system.

Upgrading Yay to a new version

Now, you may wonder how you can upgrade Yay to a newer version when it's available.

The answer is that you don't have to do anything special. Yay can update itself when you run the command:

yay -Sua

Removing Yay from your Arch system

If you don't like Yay or no longer need it anymore, you can remove it like any other package with the pacman command:

sudo pacman -Rs yay
Learn Linux Quickly - Linux Commands Book for Beginners
Learn Linux Quickly doesn’t assume any prior Linux knowledge, which makes it a perfect fit for beginners. Nevertheless, intermediate and advanced Linux users will still find this book very useful as it goes through a wide range of topics. Learn Linux Quickly will teach you the following topics:Insta…

Conclusion

That was a quick introduction to Yay AUR helper. You can visit its GitHub repository for more details on its working.

GitHub - Jguer/yay: Yet another Yogurt - An AUR Helper written in Go
Yet another Yogurt - An AUR Helper written in Go. Contribute to Jguer/yay development by creating an account on GitHub.

Arch User Repository (AUR) is one of the reasons why some people love using Arch Linux.

While purists Arch users scoff at AUR in general and AUR helpers in particular, they remain popular for the ease of use they provide.

I hope you find this quick tutorial helpful in getting Yay on Arch Linux. Please let me know if you still have questions or if you notice any technical inaccuracies.

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries πŸ•΅οΈβ€β™‚οΈ

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.