Getting started
Introduction
Yay wraps pacman to install Arch packages from the official repos and the AUR, resolving dependencies before building.
- Yay manual (jguer.github.io)
- README and examples (github.com)
- Arch Wiki: AUR (wiki.archlinux.org)
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
| Mode | What it does |
|---|---|
yay | Update everything (-Syu) |
-S, -Si, -Ss, -Su, -Sc | pacman operations with AUR support |
-R | Remove; also drops devel cache |
Yay operations
| Mode | What it does |
|---|---|
-Y | Search and install menu |
-B | Build a local PKGBUILD |
-G | Download a PKGBUILD |
-P | Print information or config |
-W | Vote or unvote on the AUR |
Source flags
| Flag | What it does |
|---|---|
-N | Target repo packages |
-a | Target 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.
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
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.
Common options
| Flag | Description |
|---|---|
--noconfirm | Skip confirmation prompts |
--needed | Skip already-installed packages |
--mflags <flags> | Pass options to makepkg |
--builddir <dir> | Use another build directory |
--batchinstall | Queue builds before installing |
--sudoloop | Keep sudo alive during builds |
--editmenu | Review PKGBUILDs before build |
See: Yay options
Files and environment
| Location | Purpose |
|---|---|
~/.config/yay/config.json | Saved options |
~/.cache/yay/vcs.json | Tracked Git commits |
AURDEST | Build directory |
EDITOR, VISUAL | PKGBUILD editor |
PAGER | PKGBUILD diff pager |
XDG_CONFIG_HOME and XDG_CACHE_HOME override the default paths.
See: Files
0 Comments for this cheatsheet. Write yours!