After spending years using apt, I made the move to arch a few years ago and love it. However, my weakness is still the package manager, pacman, and knowing what flags to use when. I do not have the muscel memory down yet.

The most helpful wiki pages include:

Below is my cheatsheet of commands:

Update Link to heading

Syncs the package database and updates the system:

1
sudo pacman -Syu

Adding another y forces syncing the pakcage database.

Install Link to heading

Install packages:

1
sudo pacman -S <package>

Remove Link to heading

Removes a package and its dependencies not required by any other installed package:

1
sudo pacman -Rs <package>

This next one requies some care before using. It can remove additional packages. Removes a package and its dependencies and all the packages that depend on the target package:

1
sudo pacman -Rcs <package>

Queries Link to heading

See all installed packages:

1
pacman -Qe

See detailed information about a package:

1
pacman -Si <package>

See what files are owned by a package:

1
pacman -Ql <package>

See what package owns a file:

1
pacman -Qo <file>

Logs Link to heading

Logs for pacman are kept in:

1
/var/log/pacman.log

Mirror Link to heading

In general I just use the default mirrors, but you can also use the reflector package to potentially find a faster mirror:

1
2
3
sudo pacman -S reflector
sudo reflector --verbose -c US --age 10 --protocol https --sort rate \
  --save /etc/pacman.d/mirrorlist

Cache Link to heading

The cache of packages that have been installed are available under /var/cache/pacman/pkg/. If needed, a user can combine these packages with the -U option to install them directly:

1
sudo pacman -U /var/cache/pacman/pkg/<package>