Install Software on Arch Linux with pacman
The pacman command is the package manager on Arch Linux and its derivatives. sudo pacman -S nginx installs nginx, and sudo pacman -Syu updates the whole system. The flags are terse, so this guide decodes the ones you need.
The essential flag pairs
pacman groups its actions into short flag pairs you will see everywhere: -S sync (install/search), -R remove, -Q query, and -U upgrade from a local file.
Update the system with -Syu
Run pacman -Syu before any big install. y refreshes the package databases and u upgrades every installed package. On Arch, never mix a partial upgrade with a full one.
Search and install with -S
-Ss searches the repositories, and -S installs. To install a package you saw in the search, reuse its exact name.
Query what is installed with -Q
-Q lists installed packages. Add -e for explicitly installed ones, or search your installs with -Qs.
Remove packages with -Rns
The remove trio is worth memorizing: -R remove, -n delete config files, -s remove dependencies nothing else needs.
For software not in the official repos, Arch users install from the AUR with helpers like yay. On Debian and Ubuntu the equivalent is apt.
Keep learning
Related guides: How to Install and Manage Packages with apt · VIM for Beginners: The Essential Guide · Linux Environment Variables: How to Set and Use Them. Read all tutorials on the Learn Linux blog.