Pacman Cheatsheet
#
pacman
is the package manager for Arch Linux and its derivatives. It is used for installing, updating, and managing software packages.
Basic Commands
#
Command/Option | Example | Description |
---|
pacman -S <package> | pacman -S nginx | Install a package |
pacman -R <package> | pacman -R nginx | Remove a package, but keep configuration files |
pacman -Rns <package> | pacman -Rns nginx | Remove a package and its unused dependencies |
pacman -U <file> | pacman -U /path/to/package.pkg.tar.zst | Install a package from a local file |
pacman -Q | pacman -Q | List all installed packages |
pacman -Qi <package> | pacman -Qi nginx | Display detailed information about an installed package |
pacman -Ql <package> | pacman -Ql nginx | List all files installed by a package |
pacman -Qd | pacman -Qd | List all dependencies that are no longer needed |
Package Database and Updates
#
Command/Option | Example | Description |
---|
pacman -Syu | pacman -Syu | Update the system and all installed packages |
pacman -Sy <package> | pacman -Sy nginx | Sync the package database and install a package |
pacman -Scc | pacman -Scc | Clean the package cache |
pacman -Syy | pacman -Syy | Force a refresh of all package databases |
Searching and Querying
#
Command/Option | Example | Description |
---|
pacman -Ss <query> | pacman -Ss nginx | Search for packages in the repositories |
pacman -Sw <package> | pacman -Sw nginx | Download a package without installing it |
pacman -Qm | pacman -Qm | List all packages that were installed explicitly, but are not in the repositories |
Miscellaneous
#
Command/Option | Example | Description |
---|
pacman -Qk <package> | pacman -Qk nginx | Verify the integrity of installed files for a package |
pacman -Qe | pacman -Qe | List all explicitly installed packages |
This cheatsheet covers essential pacman
commands and options for managing packages on Arch Linux and its derivatives.