How to Install yay on Arch Linux

Install yay on Arch Linux to manage AUR packages with pacman-style commands. Covers binary and source methods with verification.

Last updatedAuthorJoshua JamesRead time9 minGuide typeArch Linux

yay (Yet Another Yogurt) gives Arch Linux a pacman-style workflow for packages from both the official repositories and the Arch User Repository (AUR). Instead of manually cloning PKGBUILDs, resolving dependencies, and installing built packages with pacman -U, yay combines the search, review, build, install, update, and removal steps behind familiar commands such as yay -Syu.

Most users should install yay-bin, which packages the upstream prebuilt release from GitHub. The source yay package is useful when you prefer a local build or need an architecture not covered by the binary package. Both packages install the same yay command, use the same configuration file, and update through normal AUR package upgrades.

Install Yay on Arch Linux

Installing yay starts with a fully updated Arch system and the standard AUR build prerequisites. Run these commands as a regular user with sudo access; makepkg must not be run from a root shell.

Update Arch Linux

Synchronize package databases and bring the system current before building from the AUR:

sudo pacman -Syu

These commands use sudo for tasks that need root privileges. If your user is not in the sudoers file yet, run the commands as root or follow the guide on how to add and manage sudo users on Arch Linux.

A full upgrade prevents partial-upgrade conflicts, which are especially easy to hit on a rolling-release system when AUR builds are compiled against current repository packages.

Install Build Dependencies

Install the standard package-build toolchain and Git:

sudo pacman -S --needed base-devel git

The base-devel package provides the expected build tools for AUR packages, while git is required to clone AUR package repositories. The --needed flag skips packages that are already installed.

Choose yay-bin or yay Source

The AUR has two maintained yay package variants. Both install /usr/bin/yay, both depend on pacman and Git, and both are package-managed after installation.

PackageBuild SourceArchitecture ScopeBest For
yay-binDownloads the upstream prebuilt release archive from GitHub and repackages it for pacmanx86_64, aarch64, armv7hMost users on supported architectures who want the fastest install
yayDownloads the upstream source tag and compiles yay locally with GoBroader AUR source package coverage, including x86_64, several ARM variants, and riscv64Users who prefer a local build or need an architecture not covered by yay-bin

If you searched for a specific yay version, remember that the normal AUR workflow tracks the current PKGBUILD rather than pinning an old release. Use the AUR package page, yay GitHub releases, or yay -Si yay-bin after installation to check the current package version and release details.

Method 1: Install yay-bin Binary

The yay-bin package is the recommended path for supported architectures because it installs quickly and avoids pulling in the Go compiler as a build dependency.

Clone the yay-bin Repository

Clone the AUR package repository to your home directory:

git clone https://aur.archlinux.org/yay-bin.git
cd yay-bin

Review the PKGBUILD

Review the PKGBUILD before building. AUR packages are user-submitted, and this review is your chance to confirm the source URL, dependencies, checksum, and install logic:

cat PKGBUILD

The current yay-bin PKGBUILD downloads the official release archive from github.com/Jguer/yay, verifies it with a SHA-256 checksum, installs the yay binary, and declares that yay-bin provides and conflicts with yay.

Build and Install yay-bin

Build the package and install it with a single command:

makepkg -si

The -s flag installs missing dependencies, and -i installs the built package with pacman. You may be prompted for your sudo password before pacman installs the package.

Relevant output includes the source checksum and package creation steps:

==> Making package: yay-bin 12.x.x-1
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading yay_12.x.x_x86_64.tar.gz...
==> Validating source_x86_64 files with sha256sums...
    yay_12.x.x_x86_64.tar.gz ... Passed
==> Extracting sources...
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
==> Creating package "yay-bin"...
==> Leaving fakeroot environment.
==> Finished making: yay-bin 12.x.x-1

On systems with debug package generation enabled, makepkg may also install a matching yay-bin-debug package. That package is optional debug-symbol data; the removal section shows how to remove it if it appears on your system.

Clean Up the yay-bin Build Directory

After successful installation, remove the cloned repository:

cd ~
rm -rf yay-bin

Method 2: Compile yay from Source

The source package compiles yay locally. The AUR metadata lists go>=1.24 as a build dependency, and makepkg can install and remove that build dependency as part of the build.

Clone the yay Repository

Clone the source package repository:

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

Build and Install yay

Build yay from source, install the package, and remove build-only dependencies after the package is built:

makepkg -sri

The -r flag removes dependencies that were installed only for the build, such as Go on a minimal system. Keep the -r flag off if you already use Go for development and want to keep it installed.

Relevant output includes the temporary build dependency, source checksum, package creation, and dependency removal:

==> Making package: yay 12.x.x-1
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Installing missing dependencies...
:: Proceed with installation? [Y/n]
==> Retrieving sources...
  -> Downloading yay-12.x.x.tar.gz...
==> Validating source files with sha256sums...
    yay-12.x.x.tar.gz ... Passed
==> Starting build()...
==> Entering fakeroot environment...
==> Starting package()...
==> Creating package "yay"...
==> Finished making: yay 12.x.x-1
==> Removing installed dependencies...
removing go...
==> Installing package yay with pacman -U...

Current Arch makepkg settings may also generate and install a yay-debug split package. Keep it if you need debug symbols, or remove it with the optional cleanup command in the removal section.

Clean Up the yay Build Directory

Remove the cloned repository after installation:

cd ~
rm -rf yay

Understand AUR Helper Safety

The Arch User Repository contains user-maintained PKGBUILDs, not official Arch packages. An AUR helper reduces the repetitive clone, dependency, build, and install work, but it does not make AUR packages official or automatically safe.

Always read the PKGBUILD diff when yay prompts for review, especially for packages that download binaries, run install scripts, request PGP keys, or touch privileged paths. If you prefer a Rust-based AUR helper with a similar role, see the guide to install Paru on Arch Linux.

AUR helpers are community tools and are not officially supported by Arch Linux. The Arch Wiki recommends understanding manual AUR package installation before relying on helpers.

Verify Installation

Confirm that the yay command is available and owned by the package you installed:

command -v yay
pacman -Qo "$(command -v yay)"
yay --version

Relevant output for a yay-bin install looks like this. A source install reports yay as the owning package instead:

/usr/bin/yay
/usr/bin/yay is owned by yay-bin 12.x.x-1
yay v12.x.x - libalpm v16.x.x

The yay version follows the AUR package release, while the libalpm version follows the pacman library installed on your current Arch system.

Basic yay Usage

yay uses pacman-compatible syntax for official repository packages and extends it to AUR packages. It does not manage Flatpak, Snap, AppImage, or manually installed software; use those tools’ own commands for those package formats.

Search for Packages

Search for packages across repositories and AUR:

yay package-name

Running yay with just a package name performs an interactive search. Results display package names, versions, descriptions, and vote counts. Enter the number next to a package to install it.

For a non-interactive search that only displays results:

yay -Ss package-name

Install Packages

Install a package from the official repositories or AUR:

yay -S package-name

yay automatically determines whether the package is in the official repositories or AUR and handles it appropriately. For AUR packages, yay clones the PKGBUILD, prompts you to review it, resolves dependencies, builds the package, and installs it.

Update All Packages

Perform a full system upgrade including AUR packages:

yay -Syu

This synchronizes the package database, upgrades official packages, checks for AUR updates, and rebuilds any outdated AUR packages. Running yay without any arguments performs the same operation.

View Package Information

Display detailed information about a package:

yay -Si package-name

For AUR packages, this shows the maintainer, votes, popularity, dependencies, out-of-date status, and last update date. Use this for version-specific checks instead of assuming an older release is still current.

Remove Packages

Remove a package and its dependencies that are no longer required:

yay -Rns package-name

The flags remove the package (-R), delete its configuration files (-n), and remove orphaned dependencies (-s).

View System Statistics

Display package statistics and cache sizes:

yay -Ps

Relevant output includes:

==> Yay version v12.x.x
===========================================
==> Total installed packages: 156
==> Foreign installed packages: 2
==> Explicitly installed packages: 5
==> Total Size occupied by packages: 1.0 GiB
==> Size of pacman cache /var/cache/pacman/pkg/: 207.6 MiB
==> Size of yay cache /home/username/.cache/yay: 4.0 KiB
===========================================

“Foreign installed packages” refers to packages not found in the official repositories, which includes AUR packages.

Clean Package Caches

yay maintains its own cache directory for AUR build files in addition to pacman’s package cache. Cleaning these periodically recovers disk space.

Remove Unneeded Dependencies

Remove packages that were installed as dependencies but are no longer required:

yay -Yc

Clean Build Cache

Remove all cached AUR build files:

yay -Scc

This cleans both the pacman package cache and yay’s AUR cache. For a less aggressive cleanup, yay -Sc removes cached packages that are no longer installed while keeping current package files.

Configure yay Behavior

yay stores its configuration in ~/.config/yay/config.json. You can modify settings using command-line flags with the --save option to persist them.

View Current yay Configuration

Print the active configuration with yay’s show operation:

yay -Pg

The long form is also valid when it is paired with -P:

yay -P --currentconfig
{
	"aururl": "https://aur.archlinux.org",
	"buildDir": "/home/username/.cache/yay",
	"pacmanbin": "pacman",
	"version": "12.x.x",
	"diffmenu": true,
	"cleanmenu": true
}

Do not run bare yay --currentconfig. In current yay releases, the config-display option belongs to the -P show operation; without -P, yay can pass the option through to pacman and produce pacman: unrecognized option '--currentconfig'.

Enable Development Package Updates

Development packages (those ending in -git, -svn, -hg) track upstream version control rather than release versions. By default, yay does not check these for updates. Enable development package checking:

yay -Y --gendb

This generates a database of development packages. Then enable automatic updates:

yay -Y --devel --save

Now yay -Syu will also check development packages for upstream changes.

Skip PKGBUILD Review Prompts

Skipping diff review removes one of yay’s most important safety checks. If you still want to disable the diff review prompt for a trusted automation workflow, save the diffmenu setting explicitly:

yay --diffmenu=false --save

Skipping PKGBUILD review reduces security. Only disable this if you understand the risks and trust the packages you install.

Change Build Directory

By default, yay builds packages in ~/.cache/yay. To use a different directory:

yay --builddir /path/to/directory --save

Update yay

Since yay is itself an AUR package, it updates through the normal upgrade process:

yay -Syu

When a new yay version is available, it appears in the upgrade list like any other package. yay handles rebuilding and replacing itself during the upgrade.

Remove yay

Remove yay with pacman because the installed files are owned by an Arch package, even though that package came from the AUR.

Remove the Package

If you installed the source package, remove yay first:

sudo pacman -Rns yay

If you installed the binary package, remove yay-bin instead:

sudo pacman -Rns yay-bin

If makepkg installed an optional debug split package, remove the matching debug package after the main package is gone:

if pacman -Q yay-debug >/dev/null 2>&1; then
    sudo pacman -Rns yay-debug
fi

if pacman -Q yay-bin-debug >/dev/null 2>&1; then
    sudo pacman -Rns yay-bin-debug
fi

Remove Configuration and Cache

Delete yay’s configuration and build cache directories:

rm -rf ~/.config/yay ~/.cache/yay

Verify Removal

Confirm the package is no longer installed. Check the package name that matches your install method:

pacman -Q yay
pacman -Q yay-bin

Expected output after both package variants are absent:

error: package 'yay' was not found
error: package 'yay-bin' was not found

Clear the shell’s command hash before checking whether the command is still discoverable:

hash -r
command -v yay || echo "yay command not found"

Removing yay does not remove AUR packages you installed through it. Those packages remain installed and can still be managed with pacman or another AUR helper.

Troubleshooting

Cannot Run makepkg as Root

If makepkg reports that running as root is not allowed, you are building from a root shell. AUR packages must be built as a regular user for security reasons.

Create or switch to a regular user, then grant sudo through the wheel group if that user needs administrator access:

useradd -m username
passwd username
usermod -aG wheel username

Then switch to that user and run the installation commands.

yay Command Not Found

If your shell reports yay: command not found after installation, first verify which package, if any, is installed:

pacman -Q yay
pacman -Q yay-bin

If neither package is installed, repeat the install method above. If one package is installed, refresh the shell command cache and confirm the binary path:

hash -r
command -v yay
pacman -Qo "$(command -v yay)"

A healthy install should resolve to /usr/bin/yay and show either yay or yay-bin as the file owner. If the command still does not resolve, reinstall the matching package from a fresh clone.

PGP Key Verification Failed

Some AUR packages require PGP keys to verify source files. If the build fails with a key verification error, import the required key:

gpg --recv-keys KEY_ID

Replace KEY_ID with the key mentioned in the error message. Then retry the installation.

Package Build Fails

Build failures can occur because of missing dependencies, stale local build files, outdated PKGBUILDs, or upstream changes. First, ensure your system is fully updated with pacman:

sudo pacman -Syu

Check the AUR package page for comments from other users experiencing similar issues. Maintainers often post workarounds or updates.

If the package has been flagged as out-of-date on the AUR, consider waiting for the maintainer to update it or finding an alternative package.

If a stale build directory is the cause, remove the cached package build directory and retry:

rm -rf ~/.cache/yay/package-name
yay -S package-name

Conflicts with Existing Packages

When installing a package that conflicts with an existing one, yay prompts you to remove the conflicting package first. If you want to proceed, confirm the removal when prompted.

If you accidentally decline, you can manually remove the conflicting package and retry:

sudo pacman -Rns conflicting-package
yay -S desired-package

yay Hangs During Update

If yay appears to hang while checking for updates, it may be waiting for user input that scrolled off the screen. Press Enter or check if there is a prompt waiting for a response.

For non-interactive updates (useful in scripts), add the --noconfirm flag:

yay -Syu --noconfirm

Using --noconfirm skips prompts, including review points that can matter for AUR packages. Use it only when you understand the package source and accept the automation risk.

Additional Resources

Use these upstream and Arch resources when you need package metadata, release notes, or AUR workflow details:

You can also view yay’s built-in help and man page:

yay --help
man yay

Conclusion

Yay is now installed on Arch Linux through either the fast yay-bin package or the source-built yay package. Use yay -S package to install, yay -Syu to update official and AUR packages together, yay -Ss term to search, and yay -Rns package to remove packages cleanly. Keep reviewing PKGBUILDs when prompted, because yay streamlines AUR package management without changing the community-maintained trust model behind the AUR.

Share this guide

Help another Linux user troubleshoot faster

Share this guide with someone troubleshooting Linux systems or saving it for later.

Follow LinuxCapable

Want more LinuxCapable guides in Google?

Add LinuxCapable as a preferred source so Google can show more of our fresh Linux tutorials in Top Stories and From your sources when relevant.

Add LinuxCapable as a preferred source on Google
Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffeeBuy me a coffee
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Got a Question or Feedback?

We read and reply to every comment - let us know how we can help or improve this guide.

Verify before posting: