Skip to content

A simple guide to pacman (The package manager)

Pacman is the standard package manager on Arch, and most of it's derivatives, including manjaro. It has the same function as apt or yum for example, to add and remove packages from your system.

Commands

The main options are initialized with a minus and a capital Letter.

S - Synchronize of a local packagedatabase with the repositories, which are activated in the /etc/pacman.conf file. (Sync).

Q - Always refers to the local Packagedatabase of the system (Query).

R - Serves to remove packages (Remove).

D - Edit of the local packagedatabase (Database).

U - Installs packages from a local path (Upgrade).

F - Searchs for a package which includes a file (File).

These main options can be expanded with additional options written in lowercase letters.

s - Causes a search. With -Ss a packagename in the packagedatabase is searched, with -Rs the package dependencies are searched and also removed. y - Updates the packagedatabase, if there are some. yy - Forces an update of the packagedatabase.

Search packages

pacman -Ss <package> - This command will search through all packages, AUR not included.

Add packages

pacman -S <package1 package2> - Installs one or more packages.

pacman -U <package-filename> - Installs package from local file.

Remove packages

pacman -R <package> - Removes a package.

pacman -Rs <package> - As above. Package dependencies are searched and also removed.

pacman -Rsc <package> - As above. Dependencies are removed cascading. (Dependencies of dependencies are also removed)

pacman -Rscn <package> - As above. Configuration files are also removed.

pacman -Rscn $(pacman -Qdtq) - Removes all orphaned packages.

Update system

pacman -Sy && pacman -Qu - Updates the local packagedatabase and shows available updates.

pacman -Syu - Complete system update.

pacman -Sy - Updates the local packagedatabase.

pacman -Syy - Completely rebuild and update packagedatabase.

pacman -Su - Update all installed packages.

Package management

pacman -Sg - Search for installable packagegroups.

pacman -Sg <Paketgruppe> - Shows the content of the packagegroup.

pacman -Si <Paket> - Show info of package.

pacman -Scc - Empties the local packagearchive of pacman (/var/cache/pacman/pkg).

pacman -Sc - Deletes outdated packages from /var/cache/pacman/pkg as well as unused repositories from /var/lib/pacman/sync. Caution, only currently installed versions are kept. Preversions for a package-downgrade are not available anymore.

pacman -Q - Shows all installed packages on the system inclusive version number.

pacman -Qi <package> - Shows info about an installed package.

pacman -Qs <package> - Search installed packages.

pacman -Qdt - Shows orphaned packages, which where installed as dependencies, but are not needed anymore.

pacman -Qet - Shows packages which were installed explicitly, but are not needed as Dependencies.

pacman -Ql <package> - Shows all installed files on the system of a package