Pacman

Pacman is the package manager for Arch and personally I think its one of the best package managers I've experienced, it just makes sense. I want to preface this whole article by saying that it by no means is a replacement for the Arch Wiki and should be treated more like cliff-notes.

Updating Packages

sudo pacman -Syu
  • '-S' Synchronises packages between your host system and the official repos
  • 'y' Refreshes your packages database, bringing it in-line with the repos
  • 'u' Upgrades all packages that are out of date

Installing Packages

A package can be installed by chaining the update command with the name of your desired package:

sudo pacman -Syu firefox

Searching

pacman -Ss firefox
  • 's' Searches for each package in the sync databases

Searchig interactivly with fzf

pacman -Slq | fzf --multi --preview 'pacman -Si {1}' | xargs -ro sudo pacman -S
  • 'l' List all packages in the specified repo
  • 'q' Quiet - Shows less information

Querying Packages

These are a few of my favourites but there are many more...

List all explcitly installed packages (installed via pacman)

pacman -Qen
  • '-Q' Query
  • 'e' Restrict or filters output to explicitly installed packages.
  • 'n' Native packages only will be shown

List all explcitly installed AUR packages (installed manually or with an AUR helper)

pacman -Qem
  • 'm' Foreign packages only will be shown, typically packages install from the AUR

List orphaned packages

pacman -Qtdq
  • 't' Restricts or filters the output to be packages that are not explicitly installed and not required by an packages
  • 'd' Restrict or filter output to packages installed as dependencies
  • 'q' Quiet

Removing Packages

sudo pacman -Rns firefox
  • '-R' Removes a package
  • 'n' Removes system configs
  • 's' Removes dependencies

Cleaning Orphans

Orphans are packages installed as dependencies that are no longer required.

sudo pacman -Rns $(pacman -Qdtq)