Pacman

From Segfault
Jump to navigation Jump to search

Usage

Install a package:

pacman -S less

Install a package, but don't re-install already existing packages:

pacman -S --needed less cowsay

Update the whole system:

pacman -Syvu                              # --sync --refresh --verbose --sysupgrade

After updating the system (and maybe checking the Arch Linux News), be sure to examine new configuration file versions:

find /etc/ -name "*.pacnew"

Or, to diff each file to its old version:

find /etc/ -name "*.pacnew" | while read f; do echo "### $f"; diff -u ${f%%.pacnew} ${f}; echo; done

Troubleshooting

Sometimes packages break and we should consult the news to see if it's a known issue.

If there's a problem with the package signature, we could try to update the keyring:

pacman -Sy archlinux-keyring

If needed, we could clear out the package cache, remove unused repositories and try again:

pacman -Scc                               # --sync --clean --clean

Advanced Rollback if something goes wrong:[1]

  1. Point /etc/pacman.d/mirrorlist to an archive point:
    Server=https://archive.archlinux.org/repos/2021/08/23/$repo/os/$arch
  2. Execute the rollback with pacman -Syyuu resp. pacman -Syy packagename
  3. Pin pacakges afterwards in /etc/pacman.conf
    IgnorePkg = php php-apcu php-fpm php-gd php-igbinary [...]
  4. Restore the original mirrorlist

Links

References