Skip to content

Instantly share code, notes, and snippets.

@isti03
Last active May 10, 2023 08:58
Show Gist options
  • Save isti03/e6a5232be5216ac51919e1469ed625b5 to your computer and use it in GitHub Desktop.
Save isti03/e6a5232be5216ac51919e1469ed625b5 to your computer and use it in GitHub Desktop.
Useful pacman tools for Arch Linux

Important: Read the wiki and man pages, before using these tools

Tools

  • reflector: rank mirrors and generate pacman mirrorlist
  • downgrade: switch to previous versions of programs
  • paccache: clean pacman cache (part of pacman package)
  • informant: forces reading the Arch News before updating
  • pkgfile: check which package contains a command
  • pactree: display program dependencies in a tree
  • expac: list packages with many options
  • pkgstats: shares package statistics with arch developers
  • pacdiff: manage .pacnew files

Snippets

Update the mirrors

Updates the mirrors of the specified countries ranking the by the Mirror Score (see: https://www.archlinux.org/mirrors/status/)

cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist
reflector -c Hungary -c Germany --sort score --save /etc/pacman.d/mirrorlist

Cleanup

pacman -Rns $(pacman -Qtdq) #removes orphans
paccache -rk3 #deletes the cached packages, except the last 3 versions
paccache -ruk0 #deletes all the cached packages of uninstalled programs

List explicitly installed packages not in base or base-devel with description

expac "%-20n\t%10d" $(comm -23 <(pacman -Qqen | sort) <({ pacman -Qqg base-devel; expac -l '\n' '%E' base; } ))

Others

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment