pacman(8)
pacman is the package manager for Arch Linux and Arch-based distributions, handling installation, removal, and updates of software packages.
Synopsis
pacman [OPTION] [PACKAGE] ...Description
pacman manages software packages using a rolling-release model with a simple dependency resolver. It maintains a local database of installed packages and can sync with remote repositories to fetch, build, and install software.
pacman operations are specified by one primary flag (-S, -R, -Q, -U, or -F) combined with modifiers. It uses tar.zst compressed archives and can handle both binary packages and source builds through the ABS (Arch Build System).
Common options
| Flag | What it does |
|---|---|
-S, --sync | Sync packages from repositories; install, upgrade, or search for packages |
-R, --remove | Remove packages and dependencies from the system |
-Q, --query | Query the local database for installed packages and package information |
-U, --upgrade | Install or upgrade local package files |
-F, --files | Query the file database; find which package owns a file |
-u, --sysupgrade | Upgrade all installed packages to newer versions |
-s, --search | Search package names and descriptions in repositories or local database |
-i, --info | Display package information (dependencies, size, install date) |
-y, --refresh | Download fresh package lists from all configured repositories |
--noconfirm | Assume yes to all prompts; skip confirmation dialogs |
-w, --downloadonly | Download packages without installing them |
-c, --cascade | Remove packages and all packages that depend on them (with -R) |
Examples
Install the firefox package from the repositories
pacman -S firefoxRefresh package lists and upgrade all installed packages to latest versions
pacman -SyuList all installed packages and filter for those matching 'vim'
pacman -Q | grep vimSearch the repositories for packages matching 'base-devel'
pacman -Ss base-develRemove the vlc package from the system
pacman -R vlcList only explicitly installed packages (not dependencies)
pacman -QeFind which package provides the /usr/bin/python file
pacman -F /usr/bin/pythonInstall a local package file from the current directory
pacman -U ./my-package-1.0-1-x86_64.pkg.tar.zst