Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

pacman


config

Note

find the official documentation at man.archlinux.org

to edit:
# nvim /etc/pacman.conf

suggested changes:
uncomment the following lines to enable these features
Color
ParallelDownloads = 5

if you wish to install steam using pacman also uncomment these lines
multilib is for 32-bit packages, which steam still is
[multilib]
Include = /etc/pacman.d/mirrorlist


cheatsheet

Note

find the official documentation at man.archlinux.org

to just update the package index:
# pacman -Sy

to update the package index and upgrade all packages (system upgrade):
the second -u enables downgrades if needed - you want this
# pacman -Syuu

to install a package:
if you don’t know the exact name you can first search with -s
$ pacman -Ss [search-term(s)]

you should update the package index (if you haven’t v recently) first.
if the install fails, do a system upgrade before troubleshooting.
# pacman -S [exact-package-name]

to uninstall a package:
# pacman -Rns [exact-package-name]
-n prevents the creation of backup files
-s deletes unique dependancies

to clean the package cache:
only remove cached packages which are no longer installed
# pacman -Sc

remove all cached packages
# pacman -Scc

to get info on a package:
only remove cached packages which are no longer installed
$ pacman -Si [exact-package-name]

list installed packages:
lists all installed packages and their installed version number
$ pacman -Q[[metdnls]] [[search-term (if using -s)] xor [exact-package-name]]
using -m lists only ‘foreign’ packages (usually these are aur packages)
using -e lists only explicitly installed packages
using -t lists only packages which no other package depends on
using -d lists only packages which other packages depend on
using -n lists only ‘native’ packages (excludes aur packages)
using -l lists the files owned by the selected packages
using -s searches for a search-term instead of an exact package name

remove orphaned packages safely:
you can use this command to get a list of orphans to uninstall yourself
$ pacman -Qtd

Caution

the following section(s) contain(s) instructions which risk breaking your system

remove orphaned packages quickly and easily, but a typo could cost you dearly:
the first half collects a list of orphans
the second half takes the list and uninstalls all of them
if you pass the wrong list to the second half, the wrong things will get deleted
$ pacman -Qtd | sudo pacman -Rns -
it’s recommended to alias it in your ~/.bashrc file instead of typing it each time