dnf Error
Linux Linux
Severity: ModerateWhat Does This Error Mean?
dnf is the package manager for Fedora, Red Hat Enterprise Linux, and CentOS Stream. Common errors include 'Error: Failed to download metadata,' 'Multilib version problems,' and 'Unable to find a match: package-name.' Most dnf errors are caused by outdated metadata, conflicting package versions, or misconfigured repositories.
Affected Models
- Fedora
- Red Hat Enterprise Linux
- CentOS Stream
- AlmaLinux
- Rocky Linux
Common Causes
- The repository metadata cache is stale or corrupted and needs to be refreshed
- A repository is temporarily offline or has changed its URL
- Package version conflicts exist between installed packages and what the repository offers
- A COPR or third-party repository is incompatible with the current Fedora version
- Your system has expired GPG keys for a repository, causing signature verification failures
How to Fix It
-
Clean the dnf cache and refresh metadata. Run: sudo dnf clean all then: sudo dnf makecache. This downloads fresh repository metadata and clears any corrupted cached files.
Stale or corrupted metadata is the most common cause of dnf errors. Cleaning and refreshing is always the first step.
-
Check for distribution upgrades (Fedora). If you are on an old Fedora version, run: sudo dnf system-upgrade download --releasever=[version] to upgrade to the current release.
Fedora releases new versions every 6 months and supports each for about 13 months. Staying on an unsupported version means repositories go offline.
-
Fix broken packages. Run: sudo dnf distro-sync to synchronize all packages to the versions in the current repositories. This resolves most version conflict errors.
distro-sync is more aggressive than dnf upgrade — it will downgrade or replace packages that do not match the current repositories.
-
Disable a problematic repository. List repositories: sudo dnf repolist. Disable one: sudo dnf config-manager --disable [repo-name]. Then retry your command.
A single broken repository can prevent all dnf operations. Disabling it temporarily lets you continue using other repositories.
-
Fix GPG key errors. If you see 'GPG check FAILED,' update the repository's keys: sudo dnf update --refresh --nogpgcheck. Then: sudo rpm --import [gpg-key-url] to add the correct key.
Only use --nogpgcheck temporarily. Always verify you are using legitimate repositories and import the correct GPG keys.
When to Call a Professional
dnf errors are always fixable at home using the terminal commands below. If your system is critically broken after a failed system upgrade, Fedora's official forums and documentation have detailed recovery guides. For enterprise Red Hat systems, Red Hat's support subscription provides professional assistance.
Frequently Asked Questions
What is the difference between dnf and yum?
yum was the older package manager for Fedora and Red Hat. dnf replaced yum starting with Fedora 22 and is now the standard. dnf is faster, has better dependency resolution, and uses less memory. Most old yum commands work with dnf — just replace 'yum' with 'dnf.'
dnf says a transaction check failed. What does that mean?
A transaction check failure means dnf found package conflicts it cannot resolve automatically. The error message lists the conflicting packages. You can usually fix it by running: sudo dnf distro-sync or by manually removing the conflicting package and reinstalling.
How do I find which package provides a command I need?
Run: dnf provides [command-name] or dnf provides */[command-name]. For example: dnf provides ifconfig shows that ifconfig is in the net-tools package. Then install it: sudo dnf install net-tools