Description |
This article provides a method to resolve migrating Cent OS 8 to Rocky Linux 8, where the process fails due to a GPG key verification error.
The error is typically encountered in environments where the required public keys are missing or incorrectly configured, preventing package installation or upgrades via dnf or yum. |
Scope | FortiSIEM. |
Solution |
During an upgrade, the following error message appears:
- Importing GPG key 0x6D745A60: [15:16:58] pre-upgrade : PRE-UPGRADE | Check and replace CentOS with RockyLinux ...| - Error: GPG check FAILED
This indicates that the system is unable to verify the authenticity of the package due to a missing or untrusted GPG key, causing the upgrade to fail.
Ensure the necessary GPG keys are installed by running:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
If the key is missing, manually download and import it:
curl -o /etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial https://download.rockylinux.org/pub/rocky/RPM-GPG-KEY-rockyofficial rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
Verify that the correct key is installed:
rpm -q gpg-pubkey --qf "%{name}-%{version}-%{release} %{summary}\n"
If the repository metadata is outdated, refresh it:
sudo dnf clean all sudo dnf makecache
Check the repository configuration file (/etc/yum.repos.d/Rocky-Sources.repo) and ensure the GPG key path is correctly defined:
[rocky] name=Rocky Linux $releasever - BaseOS gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
If none of the above solutions work and the source of the packages (such as the official Rocky Linux repositories or internal repository) is trusted, bypass the GPG check with:
yum update --nogpgcheck -y
However, this should be a last resort, as it disables security verification of package authenticity. |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.