Install Software on Arch Linux with pacman

Published 2026-08-05 · Learn Linux

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.

$ sudo pacman -Syu

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.

$ pacman -Ss text-editor
$ sudo pacman -S vim

Query what is installed with -Q

-Q lists installed packages. Add -e for explicitly installed ones, or search your installs with -Qs.

$ pacman -Q vim
$ pacman -Qs python

Remove packages with -Rns

The remove trio is worth memorizing: -R remove, -n delete config files, -s remove dependencies nothing else needs.

$ sudo pacman -Rns vim

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.