Yayarch keeps this reference for the moments when you know what you want to do but cannot quite recall the flag. Yay follows pacman's command structure, so if you already know pacman you are most of the way there. The commands below are grouped by task rather than alphabetically, with a short explanation of what each one does and when it is useful. Everything here applies to yay version 13 and later, and nearly all of it works on older releases too.
How yay's operations are organised
Yay inherits pacman's single-letter operations and adds a few of its own. Capital letters select the operation: S for syncing and installing, R for removing, Q for querying what is installed, U for installing local package files and F for searching files. Yay adds Y for its own maintenance tasks, P for printing information, G for fetching build files, B for building local PKGBUILDs and W for web actions such as voting. Lower-case letters then refine each operation, so -Ss searches and -Si shows information. Once this pattern clicks, unfamiliar commands become much easier to read and remember.
The basics
Full system upgrade
yayTyping yay with no arguments runs yay -Syu. It refreshes the repository databases, upgrades repository packages through pacman and checks every installed AUR package for updates. This is the command you will use most.
Install a package
yay -S package-nameInstalls from the repositories if the package is there, otherwise from the AUR. You can list several packages separated by spaces.
Install only if not already current
yay -S --needed package-nameSkips any target that is already at the latest version, which saves rebuilding AUR packages unnecessarily.
Remove a package
yay -Rns package-nameRemoves the package, its saved configuration backups and any dependencies nothing else needs.
Searching and browsing
Search repositories and the AUR
yay -Ss termLists matching packages from every enabled repository and the AUR, with votes and popularity for AUR results.
Interactive search and install
yay termWithout a flag, yay shows a numbered menu of results and asks which to install. Use several words for a narrow search, as in yay linux header.
Show package details
yay -Si package-nameDisplays information such as version, maintainer, dependencies and votes for repository or AUR packages.
Show installed package details
yay -Qi package-nameShows what is installed locally, including install date and size.
Working only with the AUR or the repositories
Most operations accept --aur or --repo to restrict them.
yay -Sua
yay -Qua
yay -Ss --aur termThe first upgrades only AUR packages. The second lists AUR packages with updates available. The third searches the AUR alone.
List installed AUR packages
yay -QmLists foreign packages, meaning those not found in any sync repository. On most systems that is your AUR software.
Development packages
Packages ending in -git and similar suffixes build from the latest upstream code. Yay can track their commits.
yay -Syu --develUpgrades the system and checks development packages for new commits.
yay -Y --devel --saveMakes development checks permanent so that every yay upgrade includes them.
yay -Y --gendbBuilds yay's development package database. Run it once after installing yay if you already had -git packages, or after switching from another helper.
Cleaning up
Remove unneeded dependencies
yay -YcRemoves packages that were installed as dependencies but are no longer required, typically build tools pulled in for AUR packages.
Clean the package and build cache
yay -ScRemoves old packages from pacman's cache and offers to clean yay's AUR build directories. Running it twice as -Scc removes everything from the caches, which frees the most space but means rebuilding from scratch next time.
Build files and local packages
Download a PKGBUILD
yay -G package-nameFetches the build files for a package from the AUR or the Arch Build System into a folder in the current directory, so you can inspect or modify them.
Print a PKGBUILD
yay -Gp package-namePrints the PKGBUILD to the terminal without downloading anything to disk. Ideal for a quick check before installing.
Build and install a local PKGBUILD
yay -Bi path/to/folderInstalls any dependencies, builds the PKGBUILD in that folder and installs the result.
Force a rebuild
yay -S --rebuild package-nameRebuilds even when the version has not changed, which is useful after a library update breaks an AUR program.
Information and statistics
System statistics
yay -PsPrints a summary including the number of installed packages, how many are foreign, the size of installed packages and the largest packages on your system. A quick way to see how much of your system depends on the AUR.
Version
yay --versionShows the yay version and the libalpm version it was built against.
Voting
yay -Wv package-name
yay -Wu package-nameVote for or remove your vote from an AUR package from the terminal. Both require the AUR_USERNAME and AUR_PASSWORD environment variables. If you would rather not store credentials in your shell environment, vote on the AUR website instead.
Review and menu settings
Yay's review behaviour is controlled by its menu options. A few useful combinations follow.
yay --diffmenu --saveAsks to show diffs of changed build files before building, and saves the choice.
yay --editmenu --saveOffers to open build files in your editor before building.
yay -Y --combinedupgrade --saveCombines repository and AUR upgrades into a single menu rather than handling them in two stages.
Since version 13, these and other settings can also live in ~/.config/yay/init.lua, along with hooks that run at fixed points such as after a PKGBUILD is fetched or after sources are downloaded. Command-line flags still take priority over anything in that file.
Commands to use carefully
A few options exist for good reasons but deserve caution.
Skipping confirmations
--noconfirm answers every prompt with the default. It can be convenient in scripts, but it also skips your chance to review build files. Use it only for packages you have already checked.
Excluding packages from upgrades
The upgrade menu lets you exclude packages by number or range. Yay warns that this may cause partial upgrades. Exclude applications briefly if needed, but avoid holding back libraries.
Refreshing without upgrading
yay -Sy followed by a package name refreshes the databases and installs one package without upgrading the rest. That is a partial upgrade, which Arch does not support. Use yay -Syu package-name instead.
A compact daily routine
If you only remember a handful of commands, make them these.
yayto upgrade everything, reading each diff.yay -S package-nameto install.yay -Rns package-nameto remove.yay -Ss termto search.yay -Ycandyay -Scnow and then to tidy up.
Combining commands for common situations
Some tasks need two or three commands in sequence. These combinations come up often enough to be worth remembering as small recipes.
Installing new software safely
Upgrade first, then install, ideally in one step so the system never sits in a partial state.
yay -Syu package-nameThis refreshes the databases, upgrades everything already installed and then installs the new package, all in a single transaction for the repository part.
Rebuilding after a library change
When an AUR program stops working after an upgrade and reports a missing shared library, rebuild just that program.
yay -S --rebuild package-nameIf yay itself is the program that broke, rebuild it manually with git and makepkg, because yay cannot run to rebuild itself.
Freeing disk space after a busy month
Remove orphaned dependencies, then clean the caches.
yay -Yc
yay -ScChecking a package before you commit
Look at the build script and details first, then decide.
yay -Gp package-name
yay -Si package-nameFlags you will meet in other tutorials
Older guides sometimes use flags that still work but have better alternatives, or that behave differently than readers expect.
The --timeupdate flag makes yay compare the modification time of PKGBUILDs instead of version numbers when deciding whether to upgrade. It can catch packages whose build script changed without a version bump, but it can also trigger unnecessary rebuilds.
The --nodiffmenu and --noeditmenu style options, common in older articles, turn off review menus. Newer releases express the same idea with options such as --diffmenu=false. Either way, turning review off is rarely a good idea after the AUR incidents of 2026.
The -Syyu form forces a refresh of every database even if they appear current. It is occasionally useful after changing mirrors, but routine use only adds load to mirror servers.
Reading yay's output while commands run
Knowing a command is half the job. Understanding the messages it prints is the other half. During upgrades, lines beginning with two colons are section headings, such as synchronising databases or searching the AUR. Lines beginning with an arrow are details within a section, such as lists of missing or out-of-date AUR packages. Coloured version numbers in the upgrade list show exactly which part of the version changed, which helps you spot a major upgrade that may need extra care.
When yay finishes, it prints any packages that failed to build. Scroll back and read those errors before starting another operation.
Frequently asked questions
Is yay -Syu different from yay?
No. Running yay without arguments is an alias for yay -Syu.
How do I see which AUR packages need updating without installing them?
Run yay -Qua. It lists pending AUR updates and changes nothing.
Where are yay's settings saved?
In a configuration file in your home directory, written whenever you use --save, and optionally in ~/.config/yay/init.lua from version 13.
Can yay show me why a package is installed?
Use pacman -Qi package-name and check the required-by and install reason fields. Yay passes query operations through to pacman.
Does yay have a help page?
Yes. Run yay --help for a summary, or read the manual page with man yay.
Can I use pacman options with yay?
Yes. Yay passes standard pacman options through, so flags such as --needed, --asdeps and --ignore work as expected.
What is the difference between -Sc and -Scc?
Running yay -Sc removes packages that are no longer installed from the cache and offers to clean build folders. Running yay -Scc empties the caches completely, which frees the most space but removes the ability to downgrade from cached files.
How do I install a package as a dependency?
Add --asdeps. The package will then be treated as a dependency and removed by yay -Yc when nothing needs it any more.
Can I ignore a package for a single upgrade?
Yes. Use --ignore package-name with your upgrade command. For longer holds, add the package to IgnorePkg in pacman's configuration.
How do I search only by package name rather than description?
Use pacman-style searching with a precise term, or check details with yay -Si. Narrow search with several words also helps reduce unrelated results.
Which command shows yay's configuration?
Run yay -P --currentconfig to print the settings yay is currently using, including anything saved earlier with --save.
Conclusion
This yay commands cheat sheet covers the operations most Arch users reach for, from the one-word full upgrade to PKGBUILD inspection, cleanup and development package tracking. Learn the five daily commands first, keep the rest for when you need them, and remember the cautions around confirmations and partial upgrades. With pacman's familiar syntax as its foundation, yay rewards a little practice with a great deal of convenience.