📖 ~1 min read
Table of contents
Symptom & Impact
CentOS Stream repo GPG check fails on CentOS Stream 9 disrupts services and slows incident response until the root cause is resolved.
Environment & Reproduction
GPG verification fails after mirror swap because retired key is still pinned in repo file.
rpm -qa gpg-pubkey
cat /etc/yum.repos.d/centos*.repo
ls /etc/pki/rpm-gpg/
Root Cause Analysis
Misalignment between repo configuration and CentOS Stream 9 defaults causes the failure path described above.
Quick Triage
Confirm package state, service status, and recent changes before deeper diagnostics.
systemctl status
rpm -qa | grep -i
journalctl -p err -b --no-pager | tail -100
Step-by-Step Diagnosis
Capture detailed logs, configuration deltas, and runtime state to isolate the failing component.
dnf --refresh repolist -v
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Official
rpmkeys --checksig /var/cache/dnf/

Solution – Primary Fix
Apply the targeted configuration change and restart the relevant services to restore expected behavior.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo rpm -e gpg-pubkey-
sudo rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official
sudo dnf clean all && sudo dnf makecache

Solution – Alternative Approaches
Use –nogpgcheck only temporarily; never as a permanent fix.
Verification & Acceptance Criteria
Validate the fix with deterministic checks and ensure no regressions in dependent services.
dnf check-update
rpmkeys -l
Rollback Plan
Revert configuration and restart services to return to the previous known-good state.
rpm --import /root/backup/RPM-GPG-KEY-CentOS-Official-old
Prevention & Hardening
Mirror keys via internal Satellite and rotate on key updates.
Related Errors & Cross-Refs
Related: RPM-GPG keys, mirror swap; see also adjacent topics in the CentOS Stream 9 common problems series.
Related tutorial: View the step-by-step tutorial for centos-stream-9.
View all centos-stream-9 tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
CentOS Stream documentation, Red Hat upstream guides, and CentOS Stream 9 release notes covering this subsystem.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.