Getting started

Introduction

Yay wraps pacman to install Arch packages from the official repos and the AUR, resolving dependencies before building.

Install

sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

Use the yay-bin AUR package to skip compiling.

See: Installation

Everyday use

yay                  # refresh and upgrade everything
yay foo              # search, then pick packages to install

See: Examples

Operation modes

Pacman operations

ModeWhat it does
yayUpdate everything (-Syu)
-S, -Si, -Ss, -Su, -Scpacman operations with AUR support
-RRemove; also drops devel cache

Yay operations

ModeWhat it does
-YSearch and install menu
-BBuild a local PKGBUILD
-GDownload a PKGBUILD
-PPrint information or config
-WVote or unvote on the AUR

Source flags

FlagWhat it does
-NTarget repo packages
-aTarget AUR packages

See: Yay operations

Package operations

Search and install

yay -S foo              # install from a repo or the AUR
yay -S --needed foo     # skip packages already installed
yay -Ss foo             # search names and descriptions
yay -Si foo             # show details

See: Examples

Upgrade

yay -Syu                # upgrade repo and AUR packages
yay -Sua                # upgrade AUR packages only
yay -Syu --devel        # also check -git packages

--devel compares the Git commit hashes stored at install time.

See: First use

Clean up

yay -R foo              # remove and clear devel cache data
yay -Yc                 # remove unneeded dependencies
yay -Ycc                # also drop optional dependencies
yay -Sc                 # clean AUR cache and untracked files

yay -Sc keeps VCS sources so devel packages can pull updates.

See: Extended pacman operations

AUR workflow

Source selection

yay -Syu --repo
yay -Syu --aur
yay -Ss foo --aur

--repo and --aur limit sysupgrade to one source; dependencies still resolve from both.

See: New options

Build a local PKGBUILD

yay -B ./pkg
yay -Bi ./pkg
yay -Bi ./pkg --mflags "--skipchecksums"

AUR dependencies are resolved before makepkg runs. Only skip integrity checks for sources you trust.

See: Build options

Download a PKGBUILD

yay -G foo
yay -Gp foo
yay -Gf foo

-G uses ABS for repo packages and the AUR otherwise. -p prints; -f overwrites.

See: getpkgbuild options

Development packages

yay -Y --gendb
yay -Y --devel --save

Run --gendb once after migration; only Git sources are tracked.

See: First use

Voting

yay -Wv foo
yay -Wu foo

Voting needs AUR_USERNAME and AUR_PASSWORD.

See: Web options

Configuration

Inspect info

yay -Ps                 # installed-package statistics
yay -Pd                 # print the default config
yay -Pg                 # print the current config
yay -Pw                 # new Arch news
yay -Pww                # all available news
yay -Pwq                # news titles only

-Ps also reports orphaned, out-of-date, and missing AUR packages.

See: Show options

Save settings

yay --editmenu --diffmenu=false --save
yay --noanswerupgrade --save

--save writes to config.json. --answerupgrade preselects a reply; --noanswerupgrade clears it.

See: Permanent configuration settings

Common options

FlagDescription
--noconfirmSkip confirmation prompts
--neededSkip already-installed packages
--mflags <flags>Pass options to makepkg
--builddir <dir>Use another build directory
--batchinstallQueue builds before installing
--sudoloopKeep sudo alive during builds
--editmenuReview PKGBUILDs before build

See: Yay options

Files and environment

LocationPurpose
~/.config/yay/config.jsonSaved options
~/.cache/yay/vcs.jsonTracked Git commits
AURDESTBuild directory
EDITOR, VISUALPKGBUILD editor
PAGERPKGBUILD diff pager

XDG_CONFIG_HOME and XDG_CACHE_HOME override the default paths.

See: Files

0 Comments for this cheatsheet. Write yours!