Yay Arch Linux Install: Setting Up the AUR Helper the Right Way

A careful walkthrough of the yay Arch Linux install, covering prerequisites, source and binary builds, first checks, configuration and common mistakes to avoid.

Yay Arch Linux Install: Setting Up the AUR Helper the Right Way

Yayarch put this walkthrough together for anyone who has just finished an Arch Linux installation and wants access to the Arch User Repository without building every package by hand. Installing yay is usually the first thing people do after setting up a desktop, and it is a small job, yet a surprising number of problems later on trace back to a hurried first install. Taking ten minutes to do it properly gives you a helper that updates itself, respects your system and stays out of the way.

What you are actually installing

Yay, short for Yet Another Yogurt, is an AUR helper and pacman wrapper written in Go. It is maintained by Jo Guerreiro and has been on the AUR since October 2016. The current release line is version 13, and version 13.1 arrived in November 2026 with faster dependency resolution and better search.

It helps to be clear about what yay is not. It is not part of the official Arch repositories, and Arch Linux does not support it. Pacman remains the package manager. Yay simply sits on top, passes repository work to pacman and adds the extra steps needed for AUR packages: fetching the build script, resolving dependencies, calling makepkg and handing the finished package back to pacman.

Because yay itself lives in the AUR, there is a small chicken-and-egg moment. You cannot use yay to install yay, so the very first build is done manually. After that, yay keeps itself current like any other AUR package.

Before you begin

A clean result depends on a healthy starting point. Work through these checks first.

  • Update the whole system with sudo pacman -Syu and reboot if a new kernel was installed.
  • Make sure you are logged in as a normal user, not root. Makepkg deliberately refuses to build as root.
  • Confirm that your user can run sudo, doas or run0. Yay asks for elevated rights only at the moment a package is installed.
  • Check that you have a working internet connection and a few hundred megabytes of free space in your home directory for the build.

The last point matters more than people expect. Builds happen inside your cache directory, and large AUR packages such as web browsers can need several gigabytes. Yay itself is small, but it is worth getting into the habit of checking space before big builds.

Installing the build tools

Every AUR package is built from source or repackaged locally, which means you need the standard build toolchain. On Arch this is the base-devel group, along with git for fetching build scripts.

sudo pacman -S --needed git base-devel

The --needed flag tells pacman to skip anything already present, so it is safe to run even if you installed these during setup. Base-devel brings in gcc, make, fakeroot, binutils and the rest of the tools makepkg expects to find.

Choosing between yay and yay-bin

There are two sensible ways to perform the first install, and both give you exactly the same yay command afterwards.

The first is the yay package. It downloads the Go source code and compiles it on your machine. This needs Go version 1.24 or newer as a build dependency, which makepkg will install automatically when you use the -s flag. Compiling takes a minute or two on a modern computer.

The second is yay-bin. It downloads a precompiled binary published by the yay project and packages it for pacman. It skips the Go toolchain entirely, so it is quicker and lighter, which makes it a good choice on older laptops, virtual machines and ARM boards.

There is also yay-git, which tracks the development branch. It is useful if you want to test fixes before a release, but it is not the right choice for a first install on a machine you rely on.

Building yay from source

Choose a working directory, such as a folder for builds in your home directory, and run the following.

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

Here is what happens behind the scenes. Git copies the package's build files from the AUR. Makepkg reads the PKGBUILD, installs any missing dependencies with pacman because of the -s flag, downloads the source archive, verifies its checksum, compiles the program and creates a package file. The -i flag then asks pacman to install that package.

Before you press enter, open the PKGBUILD in a text editor and read it. It is short. You should see the yay GitHub project as the upstream address, the GPL-3.0-or-later licence, pacman and git as dependencies and a single source archive. Reading build scripts is a habit worth forming now, because yay will show you the same kind of file for every AUR package you install later.

Building yay-bin instead

The steps are almost identical.

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

The difference is in the PKGBUILD. Instead of a source archive, it lists architecture-specific binary archives, typically for x86_64, aarch64 and armv7h. Makepkg picks the right one for your machine.

Confirming the installation

Run the version command.

yay --version

You should see the yay version followed by the libalpm version it was built against. That second number becomes relevant later, because it is the source of the most common yay error after major pacman upgrades.

Once you are satisfied, you can delete the folder you cloned. Yay now lives in pacman's database, and pacman -Qi yay will show its details like any other package.

Your first real commands

Try a search to see yay at work.

yay -Ss visual studio code

Results from the official repositories and the AUR appear together, clearly labelled. To install a package from the AUR, use the same syntax you would use with pacman.

yay -S visual-studio-code-bin

Yay asks a few questions at the start, such as whether you want to review the build files, then builds and installs without further interruption. This up-front style is deliberate. You can answer everything and walk away while the build runs.

To update everything, official packages and AUR packages alike, simply type:

yay

On its own, yay is an alias for yay -Syu, the full system upgrade.

Sensible first configuration

Yay works well out of the box, but a few settings are worth considering early. Settings can be saved permanently with the --save flag, which writes them to yay's configuration file in your home directory.

  • yay -Y --devel --save makes every upgrade check development packages, those ending in -git, for new commits.
  • yay -Y --gendb builds the database yay uses to track those development packages. Run it once if you installed any -git packages before yay.
  • yay --editmenu --save offers to open each PKGBUILD in your editor before building, which some people prefer to a diff.

From version 13, yay also reads an optional Lua file at ~/.config/yay/init.lua. It can hold settings and hooks that run at fixed points in the install and upgrade flow, such as after a PKGBUILD is fetched. If the file does not exist, no Lua code runs at all. It is entirely optional, but it is a powerful tool for anyone who wants extra safety checks.

Mistakes worth avoiding

Most problems with a new yay install come from a handful of habits.

Running yay with sudo

Typing sudo yay feels natural if you are used to sudo pacman, but it causes makepkg to fail with an error about building as root. Run yay as your normal user and let it ask for your password when needed.

Building inside system folders

Some older tutorials clone the repository into /opt and then change ownership. There is no need for that. Your home directory is the right place for builds, and it keeps permissions simple.

Skipping the review step

It is tempting to accept every default and never look at a build script. After the AUR malware incidents of 2026, when more than 1,500 orphaned packages were briefly hijacked, reading diffs is no longer optional good practice. It is your main line of defence.

Partial upgrades

Installing a single new repository package without updating the rest of the system can leave libraries out of step. Running a full yay upgrade before installing new software avoids this entirely.

Keeping yay itself current

Because yay is an AUR package, a normal full upgrade updates yay as well. You never need to repeat the manual build unless something breaks it, which is usually a major pacman upgrade that changes the libalpm library version. In that case, the fix is simply to repeat the clone and makepkg steps above, ideally with yay-bin for speed.

Removing yay if you ever need to

Should you decide to switch helpers or start again, removal is straightforward. Run sudo pacman -Rns yay to remove the package. Your configuration and cache live in your home directory, inside the yay folders under ~/.config and ~/.cache, and can be deleted by hand if you want a completely clean slate. Packages you installed with yay are unaffected, because pacman owns them.

A note for virtual machines

Yay installs in a virtual machine exactly as it does on real hardware. Give the virtual machine enough memory and disk space for any large AUR builds you plan, because compiling big projects inside a small virtual disk is the most common cause of failed builds there.

Frequently asked questions

Can I install yay with pacman on plain Arch Linux?

No. Yay is not in the official Arch repositories, so the first install must be done with git and makepkg. Some Arch-based distributions, such as Manjaro and CachyOS, package yay themselves, and there pacman can install it directly.

Do I need Go installed permanently?

Only if you build the source package, and even then makepkg installs Go as a build dependency. You can remove it afterwards with yay -Yc, which clears dependencies no longer needed.

Is yay-bin less trustworthy than yay?

Both are maintained by the same person and point to the same upstream project. The source package lets you compile what you can read, while the binary package trusts the project's release builds. Either is a reasonable choice.

How much disk space does yay need?

Yay itself is small. The space that matters is the build cache, which grows with every AUR package you install. Clearing it occasionally with yay -Sc keeps it under control.

What if makepkg says a PGP key is unknown?

Some AUR packages verify signatures from upstream developers. Read the package's AUR page to confirm the expected key, then import it with gpg before building. Never disable signature checks to get past the error.

Conclusion

A yay Arch Linux install is quick, but doing it with care pays off for as long as you use the machine. Update the system first, install base-devel and git, build either yay or yay-bin as your normal user, read the PKGBUILD and confirm the version. From there, a single yay command keeps both your official packages and your AUR software up to date, and the habits you form during this first install, especially reading build scripts, will protect your system long after the setup is forgotten.