Yay is an AUR helper written in Go. It automates package management tasks for the Arch User Repository (AUR), including searching, dependency resolution, and building packages.
The tool uses the same command syntax as pacman. It handles both AUR and official repository packages in a single interface.
pacman -S yay.
Install Yay on Arch Linux
Installing Yay requires cloning the source from the AUR and building it with makepkg. Complete the following steps as a non-root user with sudo privileges.
Step 1: Install Prerequisites
Update the system and install required packages:
$ sudo pacman -Syu
Install base-devel and git:
$ sudo pacman -S --needed base-devel git
The --needed flag skips packages already installed on the system.
Step 2: Clone the Yay Repository
Clone the Yay package from the AUR:
$ git clone https://aur.archlinux.org/yay.git
Change to the cloned directory:
$ cd yay
yay-bin instead of yay to install a precompiled binary. This avoids compiling from source.
Step 3: Build and Install Yay
Build and install the package using makepkg:
$ makepkg -si
The -s flag installs dependencies. The -i flag installs the built package.
Verify the installation:
$ yay --version
Remove the cloned directory after installation:
$ cd ..
$ rm -rf yay
Use Yay for Package Management
Yay follows the pacman command structure. The table below lists common operations.
| Command | Description |
|---|---|
yay |
Update all packages (AUR and official) |
yay -S package_name |
Install a package |
yay -Ss search_term |
Search for packages |
yay -R package_name |
Remove a package |
yay -Rns package_name |
Remove a package with dependencies and config |
yay -Sua |
Update AUR packages only |
yay -Yc |
Remove unneeded dependencies |
Search for a package interactively:
$ yay package_name
This displays matching packages from both AUR and official repositories. Enter the number corresponding to the package to install it.
Upgrade Yay to a New Version
Yay updates itself through the standard upgrade process. Run the following command to update all AUR packages including Yay:
$ yay -Sua
Alternatively, run yay without arguments to update all system packages.
Remove Yay from Arch Linux
Remove Yay using pacman:
$ sudo pacman -Rs yay
The -s flag removes dependencies installed exclusively for Yay.
FAQs
Install base-devel and git with pacman. Clone the Yay repository from the AUR using git. Run makepkg -si in the cloned directory to build and install.
The yay package compiles from source during installation. The yay-bin package installs a precompiled binary, which is faster but may lag behind the latest release.
No. Running Yay with sudo is not recommended and can cause permission issues. Yay prompts for the password when elevated privileges are needed during installation.
Run yay -Sua to update only AUR packages. Run yay without arguments to update all packages from both AUR and official repositories.
Reinstall Yay manually. Clone the repository again with git and run makepkg -si. This error occurs when pacman upgrades separately from Yay.