Yay

AUR helper for Arch Linux - search, install, and manage packages from official repos and AUR.

cli
yayarchlinuxaurpackage-manager

Installation

# Install yay (requires base-devel and git)
sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si                        # Build and install

Searching

# Search for packages (official repos + AUR)
yay searchterm                     # Interactive search with results

# Search only in AUR
yay -a searchterm                  # AUR packages only

# Search for exact package name
yay -Ss ^packagename$              # Regex search

Installing Packages

# Install a package
yay -S package-name                # Install from repos or AUR

# Install without confirmation
yay -S --noconfirm package-name    # Skip prompts

# Install and clean build files
yay -S --cleanafter package-name   # Remove build files after install

# Install specific version
yay -S package-name-1.2.3          # Specify version

Updating System

# Update all packages (official + AUR)
yay                                # Same as yay -Syu

# Update with development packages
yay -Syu --devel                   # Include *-git packages

# Update only AUR packages
yay -Sua                           # Skip official repos

# Update and show diffs
yay -Syu --combinedupgrade         # Review PKGBUILD changes

Removing Packages

# Remove a package
yay -R package-name                # Remove package only

# Remove with dependencies
yay -Rs package-name               # Remove package + unused deps

# Remove with all dependencies
yay -Rns package-name              # Remove package + deps + config files

# Remove orphaned packages
yay -Yc                            # Clean unneeded dependencies

Package Information

# Show package information
yay -Si package-name               # Show package details

# Show installed package info
yay -Qi package-name               # Query installed package

# List files in package
yay -Ql package-name               # List all files

# Check which package owns a file
yay -Qo /path/to/file              # Find package owner

Clean Operations

# Clean package cache
yay -Sc                            # Remove old packages from cache

# Clean all cached packages
yay -Scc                           # Remove all packages from cache

# Remove unneeded dependencies
yay -Yc                            # Clean orphaned packages

# Clean build files
yay -Y --clean                     # Remove cached build files

Statistics and Info

# Show yay statistics
yay -Ps                            # Package statistics

# List explicitly installed packages
yay -Qe                            # Show user-installed packages

# List AUR packages
yay -Qm                            # Show foreign/AUR packages

# Check for updates without installing
yay -Qu                            # List available updates

Common Options

# Answer yes to all prompts
yay -S --noconfirm package         # Skip confirmation prompts

# Edit PKGBUILD before building
yay -S --editmenu package          # Review build files

# Rebuild package from AUR
yay -S --rebuild package           # Force rebuild

# Skip dependency checks
yay -S --nodeps package            # Install without checking deps

# Download only (don't install)
yay -G package-name                # Get PKGBUILD and files

Configuration

# Edit yay config
yay --save --combinedupgrade       # Save as default behavior

# Show current configuration
yay -P -g                          # Display config

# Reset yay configuration
yay --gendb                        # Regenerate development database

Useful Workflows

# Full system update with cleaning
yay -Syu --cleanafter              # Update and clean build files

# Search, review, and install
yay -S package                     # Interactive install with review

# List and remove orphans
yay -Qtdq | yay -Rns -             # Remove all orphaned packages

# Update only development packages
yay -Syu --devel --timeupdate      # Update *-git packages

Yay vs Pacman

# Package Installation
pacman -S package                  # Pacman: Official repos only
yay -S package                     # Yay: Official repos + AUR

# System Update
pacman -Syu                        # Pacman: Update official packages
yay -Syu                           # Yay: Update official + AUR packages
yay                                # Yay: Shorthand for full update

# Search
pacman -Ss searchterm              # Pacman: Search official repos
yay searchterm                     # Yay: Search repos + AUR (interactive)

# Removing Orphans
pacman -Qtdq | pacman -Rns -       # Pacman: Manual pipe required
yay -Yc                            # Yay: Built-in orphan removal

# PKGBUILD Review
# Pacman: Manual download & review
yay -S --editmenu package          # Yay: Interactive PKGBUILD editor

# Key Differences:
# - Yay wraps pacman and adds AUR support
# - Yay uses pacman syntax (same flags)
# - Yay provides interactive search/install
# - Yay handles PKGBUILD review automatically
# - Both require sudo for system operations
# - Pacman is official, yay is community tool