Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Install DNF5 on Fedora 39 for Faster Package Management

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

DNF5 is the next-generation package manager for Fedora, offering noticeably faster dependency resolution, lower memory usage, and quicker transaction processing compared to the classic DNF4. On Fedora 39, you can install DNF5 as an optional package and start using it immediately—it works alongside the default DNF4, so you can switch back anytime. This guide walks you through the installation, basic usage, and troubleshooting.

What You'll Need

  • A Fedora 39 installation (Workstation, Server, or any spin) with an active internet connection.
  • sudo privileges (your user must be in the wheel group).
  • Terminal access—all steps are command-line based.

Step-by-Step

  1. Update your system first. Open a terminal and run:
    sudo dnf upgrade --refresh
    This ensures all existing packages are up to date, reducing the chance of dependency conflicts when installing DNF5.
  2. Install DNF5. The package is available in the official Fedora repositories. Run:
    sudo dnf install dnf5
    DNF4 will be used to install DNF5—this is normal. Confirm the installation when prompted.
  3. Verify the installation. Check the version to confirm it's working:
    dnf5 --version
    You should see output like dnf5 version 5.x.x.
  4. Use DNF5 for everyday tasks. The command syntax is very similar to DNF4. For example:
    • Install a package: sudo dnf5 install <package-name>
    • Remove a package: sudo dnf5 remove <package-name>
    • Search for a package: dnf5 search <keyword>
    • Update all packages: sudo dnf5 upgrade
    You can also use dnf5 for history, info, and autoremove—just like DNF4.
  5. Optionally, make DNF5 your default. If you prefer DNF5 over DNF4, you can create an alias in your shell configuration file (e.g., ~/.bashrc for Bash):
    alias dnf='dnf5'
    Then reload with source ~/.bashrc. This only affects your user; system tools still use DNF4 unless changed system-wide.
  6. Keep DNF5 updated. Since DNF5 is a regular package, it will be updated along with the rest of the system when you run sudo dnf upgrade or sudo dnf5 upgrade.

Common Mistakes

  • Running DNF5 as root without sudo. Always use sudo dnf5 for system-level changes. Running dnf5 install without sudo will fail with a permission error.
  • Assuming DNF5 replaces DNF4 automatically. It doesn't—both coexist. You must explicitly use dnf5 to invoke it.
  • Using incompatible commands. While DNF5 is largely compatible, some obscure DNF4 options are not yet implemented. If a command fails, check the help (dnf5 --help) or fall back to DNF4.
  • Not updating before install. Skipping the upgrade step can lead to dependency errors, especially if your system is several weeks old.

Tips

  • Use dnf5 history to undo changes. DNF5 keeps a transaction history, so you can revert a recent install or removal with sudo dnf5 history undo <ID>.
  • Speed up with parallel downloads. DNF5 enables parallel downloads by default, but you can tune the number of simultaneous downloads in /etc/dnf/dnf.conf by setting max_parallel_downloads=10 (or higher).
  • Test commands with --assumeno. Add --assumeno to any transaction command to see what would happen without actually doing it. For example: sudo dnf5 install <package> --assumeno.
  • Use dnf5 provides to find which package owns a file. This is handy when you need a command but don't know the package: dnf5 provides /usr/bin/ffmpeg.

Troubleshooting

If DNF5 fails to install:

  • Make sure your system is fully updated: sudo dnf upgrade --refresh.
  • Check that the package is available: dnf list dnf5. If it's not listed, your repositories might be misconfigured—run sudo dnf repolist to verify.

If DNF5 commands error with “unknown option” or “unrecognized argument”:

  • DNF5 is still evolving; some DNF4 options are not yet ported. Use dnf5 --help to see supported options, or fall back to DNF4 for that specific task.

If DNF5 is slow or hangs:

  • Check your network connection and try again. If the problem persists, clear the DNF5 cache: sudo dnf5 clean all.
  • If a transaction is stuck, you can interrupt with Ctrl+C and run sudo dnf5 history to see if it left a partial transaction. You can undo it with sudo dnf5 history undo last.

If DNF5 and DNF4 conflict:

  • They should coexist peacefully, but if you see errors about locked databases, wait a moment and try again—only one package manager can run at a time.
  • If you ever want to remove DNF5, simply run sudo dnf remove dnf5 (using DNF4).

Frequently Asked Questions

Is DNF5 faster than DNF4?

Yes, in most cases. DNF5 uses a C++ core and has improved parallel downloading, which reduces dependency resolution time and overall transaction time, especially on systems with many packages.

Can I use DNF5 and DNF4 interchangeably?

Yes, they use the same repositories and package database. You can install with one and remove with the other, though it's best to stick to one for a given transaction to avoid confusion.

Will DNF5 break my system?

No. DNF5 is a drop-in replacement that has been tested in Fedora 39. It's safe to use for daily operations, and you can always revert to DNF4 if you encounter issues.

Do I need to uninstall DNF4?

No. DNF4 remains the default until Fedora 41, and many system tools still rely on it. Keep both installed.

Can I set DNF5 as the default for all users?

Yes, but it's not recommended unless you know what you're doing. You can create a symlink or modify system aliases, but this may break scripts that expect DNF4 behavior. It's safer to use the alias method for your own shell.

What if a package isn't found with DNF5 but is with DNF4?

This is unlikely since they share repositories, but if it happens, run sudo dnf5 makecache to refresh metadata, then try again. If it still fails, use DNF4 to install that package.