Arch Linux Maintenance Basics

Short guid for keeping yur Arch fresh

If you didn’t update your system for long time you might encounter problems with installation of new packages. Here is my guide of how to resolve those issues.

Update Mirror List

Install python reflector script

1
# sudo pacman -S reflector

Update Arch mirrors at /etc/pacman.d/mirrorlist

1
# sudo reflector --latest 40 --protocol https --country 'Sweden, Netherlands, Finland, France, Germany, "United States", "United Kingdom", Japan, Singapore'  --sort rate --save /etc/pacman.d/mirrorlist

Update archlinux-keyring

If system is old enough and it shows problems with gpg signatures

1
# sudo pacman -Sy archlinux-keyring && sudo pacman -Su

Set system clock

For old systems it might be important to update date and time for proper work of signature verification.

  • Update system date and time
1
# sudo timedatectl set-time "yyyy-mm-dd hh:mm:ss"
  • Set hardware clock from system clock
1
# sudo hwclock --systohc
  • Show hardware clock
1
# sudo hwclock --show

Update the system

Regularly update the system. Here is command for doing this in a normal situation

1
# sudo pacman -Syu

If you changed the mirrors you might want to refresh all package lists and force downgrade any potentially too-new packages from new mirror

1
# sudo pacman -Syyuu

Delete orphan packages

Orphan packages are build dependencies for some other packages. It is unneeded for system work. You might consider delete it for saving some disk space

1
# sudo pacman -Qtdq | sudo pacman -Rns -

Clean the Package Cache

Pacman keeps cached versions of all previously installed packages. Sometimes it could occupy a lot of disk space. To prevent this install paccache

1
# sudo pacman -Syu pacman-contrib

Remove all cached versions of packages except most recent 2 versions

1
# sudo paccache -rk2

Remove cached uninstalled packages

1
# sudo paccache -ruk0

Reboot the systen

After update don’t forger to update your system for proper installation of kernel modules

1
# sudo reboot

Congratulations your fresh system is up and running!

0%