Skip to the content
pacman-master.com

pacman commands, by operation

pacman is driven by one capital operation letter and a string of lowercase modifiers: -S synchronises from the repositories, -R removes, -Q queries the local database, -U installs a package file from disk. The cheat sheet below lists the pacman commands built from those letters, what each one does, and whether it needs root.

sudo pacman -Syu
-S
--sync — install packages from the repositories and upgrade the system
-y
--refresh — refresh the package databases from the mirrors
-u
--sysupgrade — upgrade every installed package that is out of date

Needs root.

What it does. The one command to remember: refresh the databases and upgrade everything in a single transaction.

Watch out. A doubled letter is a different command: -Sc and -Scc delete different things, and so do -Sy and -Syy.

The table

The danger column says how far a command reaches past the words you typed, in the three levels the explainer uses: routine, caution and risky. Paste a command from the table into the explainer to see how its letters are read.

Some blocks elsewhere show a line the explainer will not read: a different program such as makepkg or rm, a pipe, or a shell substitution. A block like that is marked not pacman and carries no level, because a level describes pacman's own options.

Type in the filter box to narrow the table; it matches the command text and the description at the same time. Try orphan, cache or -Q.

pacman commands by operation, with the root column and how far each one reaches
CommandWhat it doesOperationRoot?Danger
sudo pacman -SyuRefresh the databases and upgrade every installed package-Syesroutine
sudo pacman -SyyuSame, but download the databases again even if they look current-Syesroutine
sudo pacman -SyuuSame, and allow packages to be replaced by older repository versions-Syesrisky
sudo pacman -SyRefresh the databases only, without upgrading anything-Syesrisky
sudo pacman -S <package>Install a package from the repositories-Syesroutine
sudo pacman -Syu <package>Install a package as part of a full system upgrade-Syesroutine
sudo pacman -S --needed <package>Install, skipping it if the same version is already installed-Syesroutine
sudo pacman -S --asdeps <package>Install but record it as a dependency rather than an explicit install-Syescaution
sudo pacman -S <group>Install a group, choosing members from the list it offers-Syesroutine
sudo pacman -Sw <package>Download into the cache without installing-Syesroutine
sudo pacman -U <file>Install a package from a local package file-Uyesroutine
pacman -Ss <pattern>Search the repositories by name and description-Snoroutine
pacman -Ssq <pattern>Same search, printing bare package names-Snoroutine
pacman -Si <package>Show what a repository knows about a package-Snoroutine
pacman -Sl <repository>List every package a repository contains-Snoroutine
pacman -Sg <group>List the members of a group-Snoroutine
sudo pacman -ScDelete the cached files of packages that are no longer installed, and the sync databases of repositories that are no longer configured-Syescaution
sudo pacman -SccDelete every file in the package cache-Syescaution
sudo pacman -R <package>Remove only the named package-Ryesroutine
sudo pacman -Rs <package>Remove it and the dependencies nothing else needs-Ryescaution
sudo pacman -Rns <package>Remove it, its unneeded dependencies and its configuration files-Ryescaution
sudo pacman -Rss <package>Remove it and its unneeded dependencies, reaching packages that were installed explicitly as well-Ryescaution
sudo pacman -Rc <package>Remove it and everything that depends on it-Ryescaution
sudo pacman -Rdd <package>Remove it with every dependency check skipped-Ryesrisky
pacman -Rp <package>Print what a removal would do without doing it-Rnoroutine
pacman -QList every installed package with its version-Qnoroutine
pacman -QqList installed package names only-Qnoroutine
pacman -QeList packages installed explicitly-Qnoroutine
pacman -QdList packages installed as dependencies-Qnoroutine
pacman -QdtList orphans: dependencies nothing requires-Qnoroutine
pacman -QdtqList orphan names only, ready to pass on-Qnoroutine
pacman -QmList packages not found in the sync databases-Qnoroutine
pacman -QnList packages that come from the repositories-Qnoroutine
pacman -QuList installed packages that are out of date-Qnoroutine
pacman -Qi <package>Show everything the local database records about a package-Qnoroutine
pacman -Qii <package>Same, plus the backup files and whether they were modified-Qnoroutine
pacman -Ql <package>List every file a package owns-Qnoroutine
pacman -Qo <path>Show which installed package owns a file-Qnoroutine
pacman -Qs <pattern>Search the installed packages-Qnoroutine
pacman -QkCheck that the files packages own are still on disk-Qnoroutine
pacman -Qc <package>Print a package's change log-Qnoroutine
pacman -Qg <group>List the installed members of a group-Qnoroutine
pacman -Qp <file>Read the metadata out of a package file instead of the database-Qnoroutine
sudo pacman -FyDownload the file databases-Fyesroutine
pacman -F <filename>Find which repository package would provide a file-Fnoroutine
pacman -Fl <package>List the files a repository package owns, without installing it-Fnoroutine
pacman -DkCheck the local database for consistency-Dnoroutine
sudo pacman -D --asexplicit <package>Re-record an installed package as explicitly installed-Dyesroutine
pacman -T <dependency>Report which of the given dependencies are not satisfied-Tnoroutine
pacman -VPrint the pacman version-Vnoroutine
pacman -S --helpList the modifiers one operation accepts-Snoroutine

Reading an unfamiliar one

If a command is not in the table, it is still made of the same parts. Strip the sudo, take the capital letter to find the operation, then look up the lowercase letters in that operation's own list with pacman -<operation> --help, or paste the line into the explainer.

If what you have is not a command but the line pacman printed when it stopped, that belongs on the error message page instead.

How to check this page

Two commands on your own machine: pacman -<operation> --help lists the modifiers that operation accepts, and man pacman opens the pacman(8) manual page these descriptions are written from. Where the descriptions come from, and what this site is not, is set out on the about page.

This page was last edited on .