Arch Linux: Practical Reference
| Type | Independent, rolling-release, general-purpose distribution (x86_64) |
| Package manager | pacman; official repositories core, extra, multilib |
| Community packages | Arch User Repository (AUR): build scripts, compiled locally |
| Release model | No versions; a new installation ISO is published monthly |
| Support | No end-of-life: only the current package set is supported |
| Kernels | linux (latest stable), linux-lts, linux-zen, linux-hardened |
| Init | systemd |
| Desktop | None by default; you choose (GNOME, KDE Plasma, Xfce, tiling WMs…) |
| Installer | Manual install from the live ISO, or the guided archinstall script |
| Documentation | Arch Wiki |
This page is the practical side: commands, maintenance and fixes. For the background on Arch's philosophy, the rolling model and the AUR, read the Arch Linux overview. To install it, follow how to install Arch Linux.
Everyday pacman commands
| Command | What it does |
|---|---|
sudo pacman -Syu | Refresh databases and upgrade the whole system |
sudo pacman -S pkg | Install a package (after a recent -Syu) |
sudo pacman -Rs pkg | Remove a package and dependencies nothing else needs |
sudo pacman -Rns pkg | Same, and delete its backed-up config files |
pacman -Ss keyword | Search the repositories |
pacman -Si pkg / -Qi pkg | Info about a repository / installed package |
pacman -Ql pkg | List files installed by a package |
pacman -Qo /path/file | Which package owns a file |
pacman -F filename | Which package provides a file (after sudo pacman -Fy) |
pacman -Qe | Explicitly installed packages |
pacman -Qdtq | Orphans: dependencies nothing requires any more |
sudo pacman -U file.pkg.tar.zst | Install a local package file (also used to downgrade from cache) |
sudo pacman -S --needed pkg… | Install only what's missing |
For the same tasks on apt, dnf and zypper, see package managers compared.
sudo pacman -Sy pkg refreshes the database but upgrades only one package, which can leave it linked against libraries you don't have yet. Use sudo pacman -Syu pkg instead. The same applies to holding packages with IgnorePkg: do it only briefly and knowingly.
A safe update routine
- Check archlinux.org/news for anything that needs manual intervention.
- Upgrade everything and read pacman's output, including warnings about
.pacnewfiles:sudo pacman -Syu - Merge configuration changes. When a package ships a new default config and you've edited yours, pacman saves the new one as
file.pacnew:sudo pacman -S pacman-contrib sudo pacdiff - Reboot after kernel, systemd, glibc or graphics driver updates.
- Clean the package cache occasionally (keeps the last three versions of each package):
sudo paccache -r # or enable the weekly timer sudo systemctl enable --now paccache.timer - Remove orphans after reviewing the list:
pacman -Qdtq sudo pacman -Rns $(pacman -Qdtq)
Keyring and mirrors
Packages are signed by Arch packagers whose keys come from the archlinux-keyring package. On a system that hasn't been updated for a while, new packagers' signatures can't be verified yet and pacman refuses the upgrade. Update the keyring first:
sudo pacman -Sy archlinux-keyring
sudo pacman -Su
This is the one accepted case of -Sy followed by a single package, because -Su immediately completes the upgrade. If signatures still fail, see pacman invalid or corrupted package (PGP signature).
Slow or failing downloads usually mean a bad mirror. reflector rewrites the mirror list with fast, up-to-date HTTPS mirrors:
sudo pacman -S reflector
sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
sudo reflector --country 'United States,Canada' --protocol https --latest 20 --sort rate --save /etc/pacman.d/mirrorlist
sudo pacman -Syyu
Replace the countries with ones near you. -Syy forces a database refresh after changing mirrors.
The AUR
Software not in the official repositories is often in the AUR as a PKGBUILD. Building one by hand:
sudo pacman -S --needed base-devel git
git clone https://aur.archlinux.org/<package>.git
cd <package>
less PKGBUILD # read it before building
makepkg -si
Helpers like yay and paru automate this and update AUR packages along with the system (paru or yay on its own runs a full upgrade). They are themselves AUR packages, are not supported by Arch, and should never be run with sudo. When an AUR package breaks after a system upgrade, rebuilding it against the new libraries usually fixes it.
Kernels, drivers and boot
- Keep a fallback kernel. Installing
linux-ltsnext tolinuxgives you a second boot entry if a new kernel regresses. Install the matching headers (linux-headers,linux-lts-headers) if you use DKMS modules. - NVIDIA: for Turing (RTX 20 / GTX 16) and newer, install
nvidia-open(ornvidia-open-dkmsfor non-default kernels) plusnvidia-utils. Older Maxwell and Pascal cards need the legacy 580 branch from the AUR or nouveau. Black screens after a driver change are covered in NVIDIA black screen fixes. - Microcode: install
intel-ucodeoramd-ucodeand regenerate the bootloader config so it's loaded early. - Initramfs:
mkinitcpiobuilds it by default; rebuild manually withsudo mkinitcpio -P. - Boot parameters: see setting kernel parameters for GRUB and systemd-boot.
Common problems and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
unable to lock database | Another pacman running, or a stale lock after a crash | Make sure no pacman is running, then see unable to lock database |
signature … is unknown trust / invalid or corrupted package | Outdated keyring | sudo pacman -Sy archlinux-keyring && sudo pacman -Su |
failed to commit transaction (conflicting files) | A file on disk not owned by any package, often from a manual install or pip | Check with pacman -Qo <file>; remove or move the unowned file. Avoid --overwrite unless the news page tells you to |
Program fails with error while loading shared libraries | Partial upgrade or stale AUR build | sudo pacman -Syu, then rebuild the AUR package |
| Kernel modules fail to load after an update | Running kernel differs from the installed one | Reboot. If /boot wasn't mounted during the update, mount it and reinstall the kernel package |
| Doesn't boot after an update | Kernel, bootloader or driver issue | Boot linux-lts or the ISO, arch-chroot, check /var/log/pacman.log, downgrade from /var/cache/pacman/pkg/ |
| Root partition full | Package cache | sudo paccache -rk1; see No space left on device |
Recovering an unbootable system
# from the Arch ISO
mount /dev/<root-partition> /mnt
mount /dev/<efi-partition> /mnt/boot # or /mnt/efi, depending on your layout
arch-chroot /mnt
grep -i upgraded /var/log/pacman.log | tail -30
pacman -Syu # finish an interrupted upgrade
mkinitcpio -P
exit
reboot
Partition names come from lsblk -f. If GRUB itself is broken, use fixing grub rescue.
Arch compared with the alternatives
Arch gives you the newest packages and full control, at the cost of doing your own integration and reading the news before updates. If you want new software with more defaults chosen for you and a predictable release every six months, Fedora is the usual alternative. For a system you rarely touch, Debian stable or Ubuntu LTS fits better. openSUSE Tumbleweed is the other major rolling distribution, with automatic Btrfs snapshots; see the openSUSE reference.
Frequently asked questions
How often should I update Arch Linux?
Updating once a week or so is a common rhythm. Update the whole system at once with sudo pacman -Syu, and check the Arch news page first for manual-intervention notices.
What is a partial upgrade and why is it unsupported?
Refreshing the package database with pacman -Sy and then installing one package without upgrading the rest. The new package can be built against libraries newer than the ones you have, which breaks programs. Always use -Syu.
Is the AUR safe?
AUR packages are user-submitted build scripts, not official packages. Read each PKGBUILD before building, prefer packages with many votes and an active maintainer, and avoid running AUR helpers as root.
Does Arch Linux have an end-of-life date?
No. Arch is rolling, so there are no versioned releases to expire. A system stays supported as long as you keep updating it, though very old installs may need extra steps such as refreshing the keyring first.
Spotted a mistake or a command that no longer works? Send a correction — pages are re-checked when reports come in.