pacman

pacman -S pacman-contrib

basic operations

  • update
pacman -Syu
paru
pacman -S pkgname
  • if in AUR
paru -S pkgname
  • remove package and its dependencies and configuration files
pacman -Rns pkgname

searching

  • package list
pacman -Q
  • search for package
pacman -Qs query
  • package information
pacman -Qi pkgname
  • list of files installed by package
pacman -Ql pkgname
  • list aur packages
pacman -Qm
  • list explicitly installed packages
pacman -Qe
  • list all explicitly installed native packages (not aur) that are not direct or optional dependencies
pacman -Qent

orphans

  • list and remove all orphan packages
pacman -Qtdq | pacman -Rns -
  • include optional requirements as well
pacman -Qttdq
  • even more aggressive (account for cycles etc.)
pacman -Qqd | pacman -Rsu --print -

cache

  • clear cache (/var/cache/pacman/pkg/) except for last three versions (from pacman-contrib)
paccache -r
  • clear cache except for currently installed packages
pacman -Sc
  • clear cache completely
pacman -Scc

rollbacks

pacman -U https://archive.archlinux.org/packages/path/packagename.pkg.tar.zst
  • if downgrade, pin version so pacman doesn't update it
  • edit /etc/pacman.conf and add package to IgnorePkg
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
IgnorePkg   = pkgname

reflector

pacman -S reflector
  • automatically update mirrorlist to select fastest mirrors
  • edit /etc/xdg/reflector/reflector.conf
--save /etc/pacman.d/mirrorlist # set the output path
--protocol https # force https
--country us # set country (get list with `reflector --list-countries`)
--latest 50 # use only the 50 most recently synchronized mirrors (--latest)
--sort rate # sort the mirrors by download speed
sudo systemctl start reflector.service
  • or
reflector --protocol https --country us --latest 50 --sort rate --save /etc/pacman.d/mirrorlist
  • I like https://iad.mirrors.misaka.one/archlinux/$repo/os/$arch :)

AUR helper

  • yay
  • paru
    • written in rust so it must be better
    • also forces you to check PKGBUILDs (which we do read carefully right?)
    • if migrating from other AUR helper
    paru --gendb
    

pacgraph

  • pacgraph makes a graph visualization of all installed packages
paru -S pacgraph
  • generate graph (svg)
pacgraph -f packages
  • convert to png with imagemagick
convert packages.svg packages.png
  • or ffmpeg
ffmpeg -i packages.svg packages.png
  • mine below

graph of my packages (18495 MB)