Fix arch corrupted trustdb

03-11-2023 - 0 minutes, 39 seconds -

As seen from this reddit thread

  • Remove or move away /etc/pacman.d/gnupg and ~/.gnupg
  • [If archlinux-keyring has issues]:
    • Try executing pacman -Sy archlinux-keyring. If it gives off signing errors disable signature verification (This is unsecure. Remember to roll back the change immediately after use) To do so open /etc/pacman.conf, locate the SigLevel = row (usually set as Required DatabaseOptional) and comment it out adding SigLevel = Never on the next row (reference the wiki for more info)
    • Re-execute pacman -Sy archlinux-keyring and then pacman -S archlinux-keyring
    • Rollback the /etc/pacman.conf change by uncommenting the "Required" line and removing the "Never" line
  • Execute as root (or with sudo)
    • pacman-key --init to reinitialize the trustdb database
    • pacman-key --populate to populate it with the default keys
    • pacman-key --refresh-keys to update the keys to the current version