Categories
Linux

AlmaLinux 8 fails GPG key check

Are you getting these errors trying to install new packages or update your existing packages? Does it look something like this?

sudo dnf upgrade almalinux-release
Last metadata expiration check: 1:48:55 ago on Tue 28 May 2024 08:39:46 PM PDT.
Dependencies resolved.
=========================================================================================================
 Package                        Architecture        Version                    Repository           Size
=========================================================================================================
Upgrading:
 almalinux-release              x86_64              8.10-1.el8                 baseos               27 k

Transaction Summary
=========================================================================================================
Upgrade  1 Package

Total size: 27 k
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] almalinux-release-8.10-1.el8.x86_64.rpm: Already downloaded
AlmaLinux 8 - BaseOS                                                     3.3 MB/s | 3.4 kB     00:00
Importing GPG key 0xC21AD6EA:
 Userid     : "AlmaLinux <packager@almalinux.org>"
 Fingerprint: E53C F5EF 91CE B0AD 1812 ECB8 51D6 647E C21A D6EA
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
Is this ok [y/N]: y
Key imported successfully
Import of key(s) didn't help, wrong key(s)?
Public key for almalinux-release-8.10-1.el8.x86_64.rpm is not installed. Failing package is: almalinux-release-8.10-1.el8.x86_64
 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: GPG check FAILED

There is a quick and easy fix that works as of Aug 2024. Run this on your OS, this will import the latest GPG keys:

rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux

Then run this to update yum/dnf:

dnf upgrade almalinux-release

Then you should be all good for you yum upgrade and install needs!

Leave a Reply

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