📖 ~1 min read
Table of contents
Symptom & Impact
DNF blocks package installation with signature verification errors, delaying patching and deployments.
Environment & Reproduction
Seen when adding third-party or internal repos without proper `gpgkey` setup.
dnf install -y mypackage
dnf repolist -v
rpm -qa gpg-pubkey*
Root Cause Analysis
Repository metadata references a signing key not imported or mismatched with package signatures.
Quick Triage
Identify failing repository and expected key URL.
grep -R '^gpgkey=' /etc/yum.repos.d
dnf -v install mypackage 2>&1 | tail -n 80
journalctl -n 30 --no-pager
Step-by-Step Diagnosis
Verify key fingerprint and repo policy.
rpm -qi gpg-pubkey*
curl -fsSL https://repo.example.com/RPM-GPG-KEY-example | gpg --show-keys --fingerprint
cat /etc/yum.repos.d/example.repo

Solution – Primary Fix
Import trusted key and ensure repo enforces signature checks.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo rpm --import https://repo.example.com/RPM-GPG-KEY-example
sudo dnf clean all
sudo dnf makecache
sudo dnf install -y mypackage

Solution – Alternative Approaches
Distribute key via config management and pin fingerprint validation in CI.
sudo install -m 0644 /tmp/RPM-GPG-KEY-example /etc/pki/rpm-gpg/
sudo sed -i 's#^gpgkey=.*#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-example#' /etc/yum.repos.d/example.repo
Verification & Acceptance Criteria
Package installs cleanly with valid signature checks enabled.
dnf install -y mypackage
rpm -q mypackage
rpm -qi gpg-pubkey* | head -n 40
Rollback Plan
Remove wrong key and revert repo file if accidental trust was introduced.
sudo rpm -e gpg-pubkey-
sudo dnf clean all
Prevention & Hardening
Never disable `gpgcheck`; automate trusted key lifecycle and fingerprint reviews.
grep -R '^gpgcheck=' /etc/yum.repos.d
dnf repolist
Related Errors & Cross-Refs
Related to TLS interception certificates, mirror tampering alerts, and expired repository metadata.
Related tutorial: View the step-by-step tutorial for rhel-10.
View all rhel-10 tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
RHEL package signing and repository security documentation.
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.