|
|
Log in / Subscribe / Register

Readying DNF5 for Fedora 41

By Joe Brockmeier
May 24, 2024

With the release of Fedora 40 it's time to start looking ahead to what Fedora 41 has in store. One of the largest changes planned for the next release is a switch to DNF5, a C++ rewrite of the DNF package manager. A previous attempt to make the switch, during the Fedora 39 cycle, was called off, and deferred to Fedora 41. The developers have had nearly a year to address compatibility problems and bring DNF5 to a state suitable to replace DNF4. Signs point to a successful switch in the upcoming release, though there may be a few surprises lurking for Fedora users.

It has been a long road to get to this point. Daniel Mach announced the start of DNF5 development in early 2020. The initial, tentative, roadmap called for replacing DNF4 in Fedora 34—which was released in April 2021. It is no surprise that it has taken significantly longer than planned: DNF is a fundamental piece of the distribution.

From a user perspective, it is not enough that that DNF5 is able to successfully install, update, remove, and generally manage software on a Fedora system—it needs to do so in a way that does not require users to re-learn how to use the tool. Even minor deviations from the prior version, like a missing option or a change in the output of the dnf command, can break build pipelines, force developers to rewrite scripts that expect the old behavior, and generally frustrate users who have learned how to use the existing tool. For some of us, the pain of the switch from Yum to DNF nine years ago is still fresh in our minds. In short, the bar for success is high, and the appetite for change is low.

DNF's developers made the first attempt at a switch ahead of Fedora 39, but the rewrite was found wanting. Instead of trying again for Fedora 40, the team regrouped and planned to try again in 2024. A new change proposal was put forward in March for Fedora 41. The Fedora Engineering Steering Council (FESCo) gave the green light on April 8 to take another run at the switch. On April 25, DNF developer Jan Kolarik announced a side tag, a build done "on the side" that does not affect the rest of the packages, for testing DNF5 and said he planned to push it into Rawhide soon in the absence of negative feedback on critical functionality.

Michael Gruber asked whether distribution upgrades would work by the time Fedora 41 was released. If DNF5 moved into rawhide now, he said, it was important to be sure that users could use it to upgrade to Fedora 42 when the time comes. Kolarik indicated that it should be available before the release:

While our goal is to deliver the final system-upgrade functionality before the stable release, some adjustments may be made during the Fedora 41 lifecycle to ensure smoother upgrades from F41 to F42.

Kevin Fenzi said he thought the system-upgrade functionality was a beta requirement. Having it available to test then, he said, was important. Kolarik noted that DNF5 had the system-upgrade command already, though it was in need of more testing. Even so, users would be upgrading Fedora 40 to 41 using DNF4: users wouldn't need to rely on DNF5 to upgrade until Fedora 42 beta.

"Maxwell G" pointed out on April 25 that the side tag includes an update to libdnf version 5.2.0, which contains breaking API changes not communicated in the change proposal. The API bump caused breakage to the fedrq tool for querying package repositories, and likely other applications. He asked whether other applications have had a chance to port to the new API and if a porting guide could be made available "so API users can fix their software before this is pushed to rawhide?"

Kolarik apologized for failing to document the major version bump in the change proposal, but said that "implementing the new functionality without breaking ABI and API would have required a lot of extra work". He promised to provide a guide to API differences between 5.1 and 5.2 (found here) and to reach out to teams that would be affected by the version bump.

On May 9, Kolarik reported that the feedback on the testing side tag was positive, and that DNF5 had moved into Rawhide. DNF5 also got a workout during the Fedora 40 release cycle as the default package manager used to build the distribution. This deployment of DNF5 was simple enough and transparent to users, because it only required telling the Mock build environment manager to install DNF5 and use it when building packages in Fedora's Koji build systems. That hit a small snag immediately with the groupinstall alias. Version 4.x of dnf accepts groupinstall or group install as a valid command to install a package group. But DNF5 has dropped groupinstall and other single-word group command aliases like grouplist, groupremove, and so on. Fenzi added an alias to support groupinstall during builds in Koji to fix the problem.

It was also discovered that dnf5 group install did not support the --allowerasing option. (That option, as the name implies, allows erasing of installed packages if needed to resolve dependencies.) Support for that option was added, and the switch to DNF5 to build the distribution was successful. Fedora 40 was built using DNF5. It is also the default now for building packages locally with Mock, for Fedora 40 and greater.

More small snags are likely to be in store for users once DNF5 becomes the default. While feature parity with DNF4 is a goal, the change proposal acknowledges that some features may not be implemented in time. The full list of changes to the command-line interface between DNF4 and DNF5 is quite lengthy, with fewer changes to the API and configuration options.

Many of the differences are minor, such as dropping command-line options that are DNF5's default behavior anyway. For example, the ‑‑all option for dnf info and dnf list has been dropped because that behavior is the default. Many options and commands have been renamed, such as updateinfo which is now advisory. There are also a number of plugins for DNF4 that have yet to be implemented for DNF5. (Plugins to be implemented are being tracked on GitHub.)

Barring any major bugs, though, it seems likely that the time has come for Fedora users to get ready for DNF5. The deadline to decide whether to go ahead or revert to DNF4 is August 8, when Fedora 41 branches from Rawhide. That leaves just a few months for testing and bug fixing to ensure that it's up to the task.



The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:

Note: you can avoid this step in the future by logging into your LWN account.


Copyright © 2024, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds