πŸ“– ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

On RHEL 9, DNF commands fail with stale metadata errors, checksum mismatch messages, or very old repo timestamps.

Environment & Reproduction

You may see ‘Failed to download metadata’, ‘repomd.xml’ checksum failures, or repeated slow package queries.

Root Cause Analysis

The local cache under /var/cache/dnf is out of sync with the currently enabled repositories or mirror content.

Quick Triage

Run ‘sudo dnf repolist -v’ and ‘sudo dnf makecache –refresh’ to confirm the exact repo and metadata status.

Step-by-Step Diagnosis

Use ‘sudo dnf clean all’ to remove cached metadata and package headers so DNF can rebuild safely.

Illustrative mockup for rhel-9 β€” rhel9-dnf-cache-refresh-26.webp
Refreshing DNF metadata and rebuilding local cache on RHEL 9 β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Run ‘sudo dnf makecache –refresh’ and then test with ‘sudo dnf check-update’ to verify clean metadata retrieval.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Illustrative mockup for rhel-9 β€” rhel9-dnf-clean-all-26.webp
Using dnf clean all and dnf makecache to recover package operations β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

List enabled repos with ‘sudo dnf repolist –enabled’ and disable invalid entries from custom .repo files if needed.

Verification & Acceptance Criteria

If using Red Hat subscription repos, confirm registration with ‘sudo subscription-manager status’.

Rollback Plan

Validate DNS resolution and outbound proxy settings because network interception often breaks metadata checks.

Prevention & Hardening

If metadata is blocked by policy, inspect denials with ‘sudo ausearch -m avc -ts recent’ and review audit logs.

Use ‘sudo journalctl -u dnf-makecache –no-pager -n 100’ to inspect timer-driven cache refresh events.

Related tutorial: View the step-by-step tutorial for rhel-9.

View all rhel-9 tutorials on the Tutorials Hub β†’

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Keep repository definitions minimal, avoid duplicate mirrors, and run periodic ‘dnf makecache –refresh’ in maintenance windows.

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.