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:
- Always update before installing. Installing without a full
-Syufirst can leave you with a partially-upgraded system, which Arch does not support. - Read the news.
archlinux.org/news/warns about breaking changes before they land in the repos. - 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.
yaywill show it; skim for anything that downloads from a non-vendor URL or runschmod 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
- Install Arch first via Install Arch Linux step by step.
- Configure boot via systemd-boot on Arch.
- Manage networking with NetworkManager.
Comments
0 total · 0 threads