DNF5, the new package manager for Fedora, delivers faster performance and a more efficient experience compared to the legacy DNF tool. Written in C++ and designed to replace DNF, YUM, Microdnf, and related tools, DNF5 reduces installation size, accelerates operations, and streamlines package management on Fedora systems. As Fedora transitions toward making DNF5 the default in upcoming releases, adopting it now allows users to benefit from these improvements and helps identify any remaining issues before full rollout.
Install DNF5 on Fedora
Step 1: Update your Fedora system to ensure all packages and repositories are current. This prevents compatibility issues and ensures DNF5 installs cleanly.
sudo dnf upgrade -y
After upgrading, reboot your system if the kernel or critical system packages were updated.
Step 2: Install DNF5 using your current package manager. On Fedora 38 and newer, DNF5 is available in the official repositories. For Fedora 37, you’ll need to enable a special repository.
- For Fedora 38 or newer:
sudo dnf install dnf5 dnf5-plugins -y
- For Fedora 37:
sudo dnf copr enable rpmsoftwaremanagement/dnf-nightly
sudo dnf install dnf5 dnf5-plugins -y
Once installation completes, you can verify DNF5 is available:
dnf5 --version
This should display the installed version of DNF5, confirming a successful setup.
Use DNF5 for Package Management
DNF5 commands mirror those of the traditional DNF, making the transition straightforward for experienced users. The key difference is using the dnf5
command instead of dnf
. Below are common usage examples:
- Upgrade all system packages:
sudo dnf5 upgrade -y
- Install a specific package (e.g., Audacity):
sudo dnf5 install audacity -y
- Remove a package:
sudo dnf5 remove audacity -y
- Search for packages:
dnf5 search packagename
- List available or installed packages:
dnf5 list [package-pattern]
- Get detailed package information:
dnf5 info packagename
- Synchronize installed packages with repository versions:
dnf5 distro-sync
- Regenerate metadata cache:
dnf5 makecache
Most standard DNF options are supported, but some advanced or legacy options may differ or be unavailable. Refer to dnf5 --help
or the official documentation for updated syntax.
Configure DNF5 as Default (Optional)
While DNF5 and DNF can coexist, their transaction histories and module states are separate. To avoid confusion, you may wish to create a shell alias or symlink so that typing dnf
uses DNF5. This is optional and should only be done if you no longer rely on features exclusive to the old DNF.
To create a temporary alias for your current shell session:
alias dnf="dnf5"
To make this alias permanent, add it to your ~/.bashrc
or ~/.zshrc
file, depending on your shell:
echo 'alias dnf="dnf5"' >> ~/.bashrc
Or for Zsh:
echo 'alias dnf="dnf5"' >> ~/.zshrc
Caution: Do not replace the system symlink for /usr/bin/dnf
unless you are certain all your scripts and tools are compatible with DNF5, as some features or plugins may not yet be fully supported.
Benefits and Limitations of DNF5
DNF5 offers a smaller installation footprint, faster operation, and a codebase written in C++ that eliminates Python dependencies. This results in speedier metadata downloads, lower memory usage, and quicker package transactions. DNF5 also consolidates the roles of DNF and Microdnf, streamlining software management across desktops, servers, and containers. Additionally, DNF5 introduces improved bash completion and more consistent configuration handling.
However, DNF5's transaction history and module state are not shared with legacy DNF. Using both tools interchangeably can cause confusion regarding which packages are managed by which tool. Some advanced options or plugins may not yet be available in DNF5, so check compatibility before migrating workflows that depend on specific features.
Graphical Package Management Alternatives
For users preferring graphical interfaces, Fedora offers several options. On GNOME, the Software application is standard, while KDE users have Discover. Both use PackageKit as an interface, which currently relies on the older DNF backend but is expected to transition to DNF5 in the future. Alternative graphical tools like dnfdragora
and yumex-ng
exist, though their compatibility with DNF5 may vary depending on Fedora version and backend support. For now, command-line usage of DNF5 provides the most reliable experience for new features and performance improvements.
Switching to DNF5 immediately improves package management speed and efficiency on Fedora, positioning your system for future updates. Keep an eye on official Fedora channels for announcements as DNF5 becomes the default in upcoming releases.
Member discussion