Skip to content

This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!


Yay

Yay is an AUR helper (written in Go). AUR helpers automate usage of the AUR (like search for AUR packages, resolving dependencies, retrieve and build AUR packages, etc).

Reference(s)

Table of contents


Install

Update your system and install the needed packages:

$ sudo pacman -Syu
$ sudo pacman -S --needed git base-devel
$ git clone https://aur.archlinux.org/yay-bin.git
$ cd yay-bin
$ makepkg -si
$ cd ..
$ rm -rf yay-bin
$ yay --version

Config

First use:

  • Run yay -Y --gendb to generate a development package database for *-git packages that were installed without yay. This command should only be run once.

  • Run yay -Syu --devel in order to check for development package updates.

  • Run yay -Y --devel --save in order to make development package updates permanently enabled (yay and yay -Syu will then always check for dev packages).


Use

  • Update all the system and packages (not only AUR ones):

    $ yay # or `yay -Syu`
    
  • Update AUR packages only:

    $ yay -Sua
    
  • Check updates for all the system and packages (not only AUR ones):

    $ yay -Qu
    
  • Check updates for AUR packages:

    yay -Qua
    
  • Search for a package (not only AUR one):

    $ yay package-to-search # or `yay -Ss package-to-search`
    
  • Install a package (not only AUR}:

    $ yay -S package-to-install
    
  • Print package information:

    $ yay -Si package-to-print-info
    
  • List packages not installed from the main repos (i.e. AUR, pkgbuild, ...):

    $ yay -Qm
    
  • Remove a package:

    $ yay -R package-to-remove
    
  • Clean package cache:

    $ yay -Sc
    
  • Clean unneeded dependencies:

    $ yay -Yc
    
  • Print system statistics:

    $ yay -Ps
    
  • Unvote for package (requires setting AUR_USERNAME and AUR_PASSWORD environment variables):

    $ yay -Wu package-to-unvote
    
  • Vote for package (requires setting AUR_USERNAME and AUR_PASSWORD environment variables):

    $ yay -Wv package-to-vote
    
  • Keep a list of all explicitly installed packages (for later backup or quick installation of a new system):

    $ pacman -Qqe > installs.txt
    

    To install packages from the previously saved list of packages, while not reinstalling already installed packages that are up-to-date, run:

    $ yay -S --needed - < installs.txt 
    

    See https://wiki.archlinux.org/title/Pacman/Tips_and_tricks#List_of_installed_packages.

Troubleshooting

Packages to exclude

Try to never exclude exclude packages when asked. Excluding packagges may cause partial upgrades and break systems). Instead just hit .

Packages to cleanBuild?

When asked Packages to cleanBuild?, it is recommanded to clean build only packages that cause problem at installation (or update). If no package cause you any trouble, you can just answer [N]one.

could not find all required packages: ...

If the could not find all required packages: ... error appears, then you can generally just clean all unneeded dependencies : yay -Yc.


If this cheat sheet has been useful to you, then please consider leaving a star here.