I created a new VPS with the AlmaLinux 8 operating system. When running the dnf update command, an error message appeared: Error: GPG check FAILED. This issue is quite confusing because GPG checks usually run smoothly. After further investigation, it turns out the cause is related to a GPG key change from the AlmaLinux team.

Cause of GPG Check Failed in AlmaLinux 8

At the end of 2023, the AlmaLinux team experienced a system failure that resulted in the loss of the master key. This key is crucial because it is used to extend the validity of the GPG key used to sign AlmaLinux 8 packages.

As a result, the old GPG key was set to expire in January 2024. To address this, AlmaLinux replaced their GPG key. However, if the system in use has not been updated since this change, it may still be using the old, expired key — this is what causes the GPG check FAILED error when running dnf update.

How to Fix GPG Check FAILED Error

To resolve this issue, you need to import the new GPG key. This is very simple:

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

This command will:

  • Import the new AlmaLinux GPG key if it is not yet on the system.
  • Do nothing if the key has already been imported and trusted.

After running the command above, you can try the dnf update command again and the update process should run normally without the GPG check FAILED error.

By following the steps above, your AlmaLinux 8 system will be able to receive package updates again without issue.