Update keyring first if your Arch Linux is old enough

My Arch Linux is not updated for nearly 3 months. When running pacman -Syu, it prompts following errors:

$ sudo pacman -Syu
......
error: python-dnspython: signature from "Eli Schwartz <eschwartz@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-dnspython-1.16.0-1-any.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]
error: python-distlib: signature from "Eli Schwartz <eschwartz@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-distlib-0.2.8-1-any.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]
error: python-pytoml: signature from "Eli Schwartz <eschwartz@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-pytoml-0.1.20-1-any.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]
error: python2-distlib: signature from "Eli Schwartz <eschwartz@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python2-distlib-0.2.8-1-any.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]
error: python2-dnspython: signature from "Eli Schwartz <eschwartz@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python2-dnspython-1.16.0-1-any.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]
error: python2-pytoml: signature from "Eli Schwartz <eschwartz@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python2-pytoml-0.1.20-1-any.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]
error: qbittorrent: signature from "Eli Schwartz <eschwartz@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/qbittorrent-4.1.5-1-x86_64.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.
......

The solution is updating archlinux-keyring first:

$ sudo pacman -S archlinux-keyring

Then all goes well!

12 thoughts on “Update keyring first if your Arch Linux is old enough”

  1. Wow…!!! Thanks mate…!!!
    I’ve same error : “unknown trust”.
    And I updated the keyring and all is well.

    Very appreciate it.
    Regards.

  2. loot% sudo pacman -S archlinux-keyring
    resolving dependencies…
    looking for conflicting packages…

    Packages (1) archlinux-keyring-20200422-1

    Total Download Size: 0.87 MiB
    Total Installed Size: 1.23 MiB
    Net Upgrade Size: 0.32 MiB

    :: Proceed with installation? [Y/n]
    :: Retrieving packages…
    archlinux-keyring-20200422-1-any
    (1/1) checking keys in keyring
    (1/1) checking package integrity
    error: GPGME error: General error
    error: archlinux-keyring: missing required signature
    :: File /var/cache/pacman/pkg/archlinux-keyring-20200422-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
    Do you want to delete it? [Y/n]
    error: failed to commit transaction (invalid or corrupted package (PGP signature))
    Errors occurred, no packages were upgraded.
    loot%

  3. I always have to search when to repopulate the keys when I get an error and there are many methods like removing the database and they not always work. This is the simplest and fastest, many thanks.

  4. thanks. pacman should be a bit smarter and not just completely panic because of a pair of packages signed with a new key but oh well i guess being an arch user is about masochism

  5. It doesn’t always work but there is another work around.

    You should also try:

    pacman-key -u
    pacman-key –populate

    and then thank me later [>~0]/

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.