|
|
Log in / Subscribe / Register

DNF replacing yum

By Nathan Willis
April 15, 2015

Fedora has been planning to replace the yum package manager for quite some time. The designated replacement, DNF, is a rewrite that offers several advantages, including faster and better dependency resolution. But users (arguably Linux users in particular) tend to get attached to their tools, so the prospect of switching over all at once can be a hard sell. The Fedora Engineering Steering Committee (FESCo) decided in June 2014 that the switch would finally take place in Fedora 22. Now that Fedora 22 is on the verge of release, though, the practical difficulties involved in changing such a low-level program have bubbled up to the surface again.

On April 1, FESCo member Kevin Fenzi outlined the changes in package management that would arrive in Fedora 22, noting that there had previously been some confusion about the plan. DNF will be installed by default, as will the transitional package dnf-yum, which turns /usr/bin/yum into a script that redirects to dnf. Nevertheless, users can still install yum manually, and the yum package will still be installed if the user installs anything that lists yum as a dependency. In addition, as Jan Silhan added, a migrate plugin has been developed that will migrate the machine's yum history and metadata to DNF.

But there is a bit more to it than that. The Fedora 22 "yum" package will also install dnf-yum as a dependency, and the yum package's executable will be /usr/bin/yum-deprecated (with /usr/bin/yum still just wrapping DNF). Furthermore, running yum will issue a warning message to the user:

    Yum command has been deprecated, use dnf instead.
    See 'man dnf' and 'man yum2dnf' for more information.
    To transfer transaction metadata from yum to DNF, run 'dnf migrate'

Below the warning, it will also notify the user that the yum command entered is being redirected to the corresponding DNF command.

Not everyone embraced this transition plan with enthusiasm, however. In reply to Fenzi, Nico Kadel-Garcia said the plan was "unnecessarily confusing" and that adding hooks for the /etc/alternatives framework would be better than renaming or redirecting binaries and making the two packages forcibly compete with each other. "This approach is old and effective for Java, for /usr/sbin/sendmail, and for numerous other tools. Why would you want to reinvent the wheel and prevent people from having either as needed?"

Jan Zelený argued that /etc/alternatives was meant to choose between active alternative tools, whereas yum is being deprecated and will be phased out. What followed next was a lengthy debate that focused largely on the relative merits of yum and DNF. Bruno Wolff questioned DNF's compatibility with yum (specifically with respect to yum's --skip-broken flag), saying that he would prefer to keep using yum than to undertake the workarounds that are necessary to make DNF behave like yum.

To that, Zelený replied that full compatibility between the two tools had never been promised:

From the very beginning, we were sending a clear message that we will be as compatible as possible in terms of CLI but we never wanted to have just another yum.

The ensuing discussion made a few viewpoints clear. First, not everyone involved has the same definition of "as compatible as possible." Zelený agreed only that the most common package-management use cases will be covered; some less-frequently-needed yum commands may never be implemented in DNF at all (in the FESCo ticket that deals with the transition plan, Josh Boyer pointed to a number of yum features that the DNF team had no plans to implement). While this is perhaps sensible from an engineering standpoint, others argued that this stance results in mixed messages for the user. As Przemek Klosowski said:

The updating problem is complex enough so that yum ecosystem is not handling it well. You are making an argument that dnf reimplemented this ecosystem in a qualitatively different, more correct way, that is so different that it merits a clean break, justifying the project name change. I am fine with that, but this leads to confusion when there are observable changes in behavior. The implication is that dnf is better and more correct, but on the other hand it's clear that dnf is still in development and exhibits faults. So, now we have a problem: if dnf behaves differently from yum, is it an improvement or a regression? We don't know, and it's not clear to me how to tell; every divergence is a potential bug in dnf, and therefore should be reported as such.

I would venture a comment that it was a mistake to declare dnf a separate project, because it leads to a different approach to such differences. If it was an evolutionary change in yum, it would be natural to expect it to behave in a compatible way, and consequently detect and explain in more detail the divergent behavior. By declaring a clean break, you are basically saying that there is no need to explain the diffs, but the flip side of it is that unless I can clearly understand why the difference is for the better, I must suspect this to be a regression and report it.

The --skip-broken flag, first brought up in the thread by Wolff, is indicative in many respects of the irritation some users feel about the yum-to-DNF transition, but it has wider implications as well. A yum update operation that used --skip-broken would skip all updates for packages with broken dependencies. DNF skips such broken updates—silently—by default. As several in the thread pointed out, there are ways to get DNF to report the existence of broken packages, such as running dnf check-update after running an update.

To Steve Clark, however, that simply means that DNF requires more work to use. To Vít Ondruch, it means that dnf update is an unreliable command. Moreover, although the DNF team seemed to regard --skip-broken as a kludge used to work around situations that are best avoided in the first place (such as mixing packages from several different repositories or package maintainers pushing broken updates), a number of users found it naive to expect that users will not have to deal with broken packages. Tom Hughes noted that feedback about broken packages from yum is one of the main ways packagers learn about packaging problems.

Zelený capped off the discussion—at least for now—by inviting community members to work on DNF plugins to implement the functionality that they want. Perhaps predictably, that answer did not sit well with everyone who participated in the thread. But regardless of how the masses may feel about the differences between DNF and yum, the long-awaited transition appears to finally be underway.

In some respects, the push to migrate Fedora from yum to DNF even through a transition some will find painful is just the most recent example of a recurring issue for free-software projects. Whether it is a compiler, a compositor, or desktop panel, making a clean break from the past is rarely easy, but sometimes it must be done. This migration may prove to be a contentious one for Fedora, but eventually the distribution will emerge on the other side.


to post comments

DNF replacing yum

Posted Apr 16, 2015 5:52 UTC (Thu) by crobson (guest, #31872) [Link] (1 responses)

I've been using Fedora 22 for a couple of weeks now. I think the hardest part of the transition will be teaching my fingers to type dnf instead of yum.

DNF replacing yum

Posted Apr 20, 2015 11:05 UTC (Mon) by basmevissen (guest, #54935) [Link]

Me too. Old habits... DNF is fine and progress goes with some breakage now and then.

I think it is a good design choice to skip packages with broken dependencies by default. If the tool gives a clear and concise warning, users are warned and the other updates get installed without the user having to do something. Often, the cause of such broken dependencies is in mirror repositories with updates taking some time to propagate and are resolved in a matter of hours.

DNF replacing yum

Posted Apr 16, 2015 10:04 UTC (Thu) by epa (subscriber, #39769) [Link] (1 responses)

To ease the transition wouldn't it make sense to make some changes to yum to move it closer to dnf's behaviour? (Given the assumption that where the two differ, the way dnf does it is preferable, because <well-argued reason that we will take on trust here>).

So for example, if --skip-broken is now the default, first change yum to move to that default setting too (with explicit --no-skip-broken for those who want the older behaviour). Release this as yum version 3.999 and migrate to it in the next Fedora release. Then the release after that dnf can be a drop-in replacement for yum with fewer behaviour changes. Kind of like how some Python 3 features were migrated back to Python 2 to help people prepare for the transition.

DNF replacing yum

Posted Apr 19, 2015 1:15 UTC (Sun) by zuki (subscriber, #41808) [Link]

> To ease the transition wouldn't it make sense to make some changes to yum to move it closer to dnf's behaviour?

It would be a lot of work to edit the legacy code base. It is rumored to be rather messy, and I don't think anybody wants to work on it. Adding something like --no-skip-broken would probably be fairly easy, but there are other differences between yum and dnf, e.g. in the dependency solver, which would be very hard to port back to yum.

Also, any change would make users of yum unhappy. It would break scripts, and yum is being kept around primarily to support existing scripts and users of the Python API.

DNF replacing yum

Posted Apr 16, 2015 16:01 UTC (Thu) by jem (subscriber, #24231) [Link] (3 responses)

I think DNF is a poor choice name, especially för a software installer. http://en.m.wikipedia.org/wiki/Did_Not_Finish

DNF replacing yum

Posted Apr 20, 2015 11:00 UTC (Mon) by basmevissen (guest, #54935) [Link]

Fedora has a history of bad name choices. The upgrade tool "fedup" is another example. Although the name serves as a warning to what to expect from it. It has left me disappointed on several occasions...

DNF replacing yum

Posted Apr 21, 2015 17:45 UTC (Tue) by xorbe (guest, #3165) [Link] (1 responses)

As an avid runner, my first reaction was, "DNF? Really?" It's quite an unwanted result.

DNF replacing yum

Posted Apr 21, 2015 18:22 UTC (Tue) by marduk (guest, #3831) [Link]

I suppose it's slightly better than DNR.

DNF replacing yum

Posted Apr 17, 2015 18:31 UTC (Fri) by yaneti (subscriber, #641) [Link]

I for one am actively avoiding it while it behaves like this.
" surprising removal of old kernels in unrelated transactions when installonly_limit is exceeded"
And if you think --exclude helps, it doesn't.

DNF replacing yum

Posted Apr 19, 2015 1:37 UTC (Sun) by zuki (subscriber, #41808) [Link]

> You are making an argument that dnf reimplemented this ecosystem in a qualitatively different, more correct way, that is so different that it merits a clean break, justifying the project name change. I am fine with that, but this leads to confusion when there are observable changes in behavior.

I find this logic rather strange. Normally when the name changes, one expects more changes in behaviour, not less.

> The implication is that dnf is better and more correct, but on the other hand it's clear that dnf is still in development and exhibits faults.

dnf *is* better — faster, cleaner internally, has a better solver, has a consistent command line interface, works with Python 3. Of course dnf has faults. But with the project this size such a statement is trivial: every project big enough has faults. Most small ones do too. It would be bad if those faults were significant, but the problems described in the thread on fedora-devel@ are more about differing expectations and not enough feedback during operation and maybe not enough documentation. dnf maintainers are nowadays very responsive and from my view point as a Fedora package maintainer the switch to dnf is progressing smoothly.

DNF replacing yum

Posted Apr 20, 2015 4:47 UTC (Mon) by apollock (guest, #14629) [Link] (9 responses)

It's nice that Fedora is open to changing their package manager. I wonder if they'll ever change their package format away from RPM?

DNF replacing yum

Posted Apr 20, 2015 13:18 UTC (Mon) by mathstuf (subscriber, #69389) [Link] (8 responses)

Doubtful. From my interactions with dpkg, I'd much rather stay with RPM than migrate to it (and even if the format does migrate, I'd much prefer to keep yum/dnf-like command tools rather than the apt* suite which I can never remember completely enough to not need a man page and a web search I use them[1]).

[1]Particularly all the subcommands of apt-cache.

DNF replacing yum

Posted Apr 21, 2015 8:48 UTC (Tue) by debacle (subscriber, #7114) [Link] (1 responses)

With Debian 8, there comes finally an "apt" command. It can be used as replacement for many "apt-get" and "apt-cache" commands. So we Debianites also need to re-train our fingers :~)

DNF replacing yum

Posted Apr 22, 2015 6:30 UTC (Wed) by jezuch (subscriber, #52988) [Link]

> With Debian 8, there comes finally an "apt" command. It can be used as replacement for many "apt-get" and "apt-cache" commands.

And it has more eye-candy! :)

DNF replacing yum

Posted Apr 22, 2015 22:28 UTC (Wed) by k8to (guest, #15413) [Link] (5 responses)

dpkg-the-command is annoying. dpkg-the-format is superior.

You can find faults, and I certainly have, but the semi-documented nature and inaccessability of the RPM binary is a bear for reliability, auditing, and other things.

DNF replacing yum

Posted Apr 23, 2015 0:29 UTC (Thu) by mathstuf (subscriber, #69389) [Link] (4 responses)

I'm not too worried about the format either, but as a packager, I do care about the tools there. RPM automatically adds provides and requires at the symbol-version level for shared objects, as well as Perl dependencies, Haskell, shebangs, etc. Maybe that's been added to dpkg as well, but I also vastly prefer a spec file to the debian/ directory layout (I do grant that spec files can get enormously complicated, but the common cases are really dead-simple).

So maybe what we need is a compkg (compromise package) toolchain with dnf for users, spec files for developers, and dpkg in between ;) .

DNF replacing yum

Posted Apr 23, 2015 1:17 UTC (Thu) by dlang (guest, #313) [Link] (3 responses)

the vast majority of the differences between .deb and .rpm a cosmetic (in that tools like alien can do lossless conversions back and forth between the formats). One thing I like about .deb is that in addition to hard dependencies there are also "recommends" and "suggests" soft depenencies.

now, I also happen to prefer the .deb directory of simple files rather than the .rpm spec file. In both cases simple things are simple to do, but when things get complicated I like the simplification of the separation that .deb provides.

DNF replacing yum

Posted Apr 23, 2015 1:53 UTC (Thu) by rahulsundaram (subscriber, #21946) [Link]

Recommends and suggests as well as supplements and enhances have been supported by various RPM distributions for years.

http://rpm.org/wiki/PackagerDocs/DependenciesOverview

This isn't really a format differentiation anymore.

DNF replacing yum

Posted Apr 24, 2015 13:44 UTC (Fri) by epa (subscriber, #39769) [Link] (1 responses)

Of course, the rpm spec file is not part of the rpm package format; there is no reason in principle why a different packaging tool couldn't produce rpm packages given a configuration more like that used for dpkg. Or indeed produce both package formats from a single config.

DNF replacing yum

Posted Apr 24, 2015 14:04 UTC (Fri) by rahulsundaram (subscriber, #21946) [Link]

If you are looking to produce rpm and deb together without having much understanding of packaging, fpm is handy

https://github.com/jordansissel/fpm


Copyright © 2015, 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