Updating a Stale Arch Linux Installation

24 May 2024

This is just a quick reminder about a topic related to Arch Linux. I’m posting it as a reference so I don’t need to spend much time searching for the solution when I come across the issue again.


I recently had to update a computer that hadn’t been touched in about a year. It’s running Arch Linux so the regular update process is to open a command line and type sudo pacman -Suy. However, if you haven’t updated the system in a while then it’s quite likely that there are some out-of-date keys that cause errors during the update. To get around that issue do the following:

  • Update the package database with sudo pacman -Syy.
  • Install the latest version of the archlinux-keyring package with sudo pacman -S archlinux-keyring.
  • Update your gpg keys with sudo pacman-key --refresh-keys. This will take quite a while to finish.
  • Run your regular system update with sudo pacman -Suy.

This post is tagged as:



Comments

2 responses to “Updating a Stale Arch Linux Installation”

  1. on the first command I get “unable to lock database”
    on the second one, I get “failed to synchronize all databases”
    on the third one, I get “failed to init transaction”

    1. hey, the first error usually happens when the /var/lib/pacman/db.lck exists (even though pacman is not running). that happens, for example, when your system is interrupted during an update. try to manually delete the db.lck file and try again

Leave a Reply

Your email address will not be published. Required fields are marked *