Community Tutorials Arch / Manjaro pacman and AUR (yay) on Arch Linux
pacman and AUR (yay) on Arch Linux
ARCH / MANJARO

pacman and AUR (yay) on Arch Linux

SKYLINE Knowledge Base
Photo by Goran Ivos on Unsplash

A field-tested, step-by-step guide. pacman and AUR (yay) on Arch Linux — prerequisites, the actual commands, verification, and links to related Arch / Manjaro topics.

pacman is the Arch Linux package manager — fast, no nonsense, written in C. AUR (Arch User Repository) is the community-driven build recipe pool that complements the official repos. This guide covers daily pacman operations plus yay, the de-facto AUR helper.

Prerequisites

  • A working Arch (or Manjaro/EndeavourOS) install with sudo.

Step 1: Sync and upgrade

Arch is rolling. Update once a week minimum:

sudo pacman -Syu               # sync DB + upgrade everything

Three rules unique to Arch:

  1. Always update before installing. Installing without a full -Syu first can leave you with a partially-upgraded system, which Arch does not support.
  2. Read the news. archlinux.org/news/ warns about breaking changes before they land in the repos.
  3. Skip nothing. If a release ships with manual intervention, do it now, not "next week."

Step 2: Install, remove, search

sudo pacman -S htop ripgrep tmux                  # install
sudo pacman -Rs unused-package                    # remove + orphan deps
sudo pacman -Rns unused-package                   # remove + deps + config files
pacman -Ss redis                                  # search
pacman -Si redis                                  # info
pacman -Qi redis                                  # installed info
pacman -Ql redis | head                           # files owned by redis
pacman -Qo /usr/bin/redis-cli                     # which package owns this file
pacman -Q                                          # everything installed
pacman -Qe                                         # only explicitly installed
pacman -Qdt                                        # orphan packages

-S = sync (remote). -Q = query (local). -R = remove.

Step 3: Cache management

The package cache lives in /var/cache/pacman/pkg/. It can grow to gigabytes — clear it periodically:

sudo pacman -Sc        # remove versions you no longer have installed
sudo pacman -Scc       # nuke the whole cache (only if disk pressure)

For a safer trim, install pacman-contrib and use paccache:

sudo pacman -S pacman-contrib
sudo paccache -r          # keep last 3 versions; remove the rest
sudo paccache -ruk0       # remove ALL cached versions of uninstalled packages

Step 4: Install yay for the AUR

yay is not in the official repos — build it from the AUR by hand:

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

(yay-bin is the precompiled package; yay builds from source if you prefer.)

Step 5: Use yay

yay -Syu                       # update official repos + AUR
yay -S google-chrome           # install from AUR
yay -Ss visual-studio          # search both official + AUR
yay -Qua                       # AUR-only update list
yay -Yc                        # clean orphans

Two cautions:

  • Read every PKGBUILD before you build it. yay will show it; skim for anything that downloads from a non-vendor URL or runs chmod 4755.
  • AUR packages are community-maintained — quality varies. Stick to packages with high vote counts and recent activity.

Step 6: Pin and ignore

To keep a kernel version stable across upgrades, edit /etc/pacman.conf:

IgnorePkg = linux linux-headers

Pacman will warn about the held-back updates each -Syu so you don't forget.

Verify

pacman -Q | wc -l                # total installed
pacman -Qdt                      # orphans
pacman -Qen | head               # explicit, official
pacman -Qem | head               # explicit, AUR/foreign
checkupdates                     # pending official updates (pacman-contrib)

Conclusion

pacman -Syu weekly, yay -S for software outside the repos, paccache -r monthly, pacman -Qdt to spot orphans. That is the full cycle.

Next steps

SKYLINE Engineering

@skyline

The engineering team at SKYLINE Industrial Solutions. We publish field-tested guides drawn from real KSA and GCC deployments.

See author profile
SKYLINE engineering services

Need this implemented for you?

Reading is free — building it right takes a team. SKYLINE engineers ship Arch / Manjaro for Aramco vendors, banks, hospitals and government agencies across Saudi Arabia. Talk to us before you start.

Aramco Approved Contractor ISO 9001 · ISO 27001 SAMA CSF aligned NCA ECC ready 247+ KSA clients

Comments

0 total · 0 threads
Be the first to leave a comment.