Fedora 22 shipped with a rather significant change under the hood: the introduction of DNF (DaNdiFied YUM) as the default package manager. The change is visible only to users that used YUM to work with Fedora packages. Users that use various graphical tools like Software and Apper should have not noticed any changes.
Basic commands remain the same
While planning the new package manager, the DNF developers aimed to make the transition from YUM to DNF as easy as possible for users. They decided to use a command line syntax which replicated YUM’s commands as much as possible. The basic commands, therefore, are exactly the same. With YUM, for instance, one would run the following command to install a package, in this case, nano:
sudo yum install nano
With DNF, one will run:
sudo dnf install nano
Similarly, to search for a package with YUM, one would use:
sudo yum search nano
With DNF, one would use the similar command:
sudo dnf search nano
Some other basic commands that remain the same are: remove, update, distro-sync, check-update, info, history, reinstall, provides, repolist, list, downgrade, clean, and makecache. Even the corresponding commands pertaining to package groups remain the same: group info, group install, group remove. Common options also remain the same, such as -y to assume “yes” for all questions, and –enablerepo/–disablerepo switches.
DNF plugins for more advanced commands
Advanced users will notice that the text does not yet mention other functions that yum-utils carried out, such as installing debuginfo packages or downloading source RPMs from the repositories. To provide such advanced functionality, DNF uses various plugins which are provided by different packages in the Fedora repositories. The table below documents some of these plugins:
YUM command | DNF command | Provided by package |
debuginfo-install |
dnf debuginfo-install |
dnf-plugins-core |
repoquery |
dnf repoquery |
dnf-plugins-core |
yum-builddep |
dnf builddep |
dnf-plugins-core |
yum-config-manager |
dnf config-manager |
dnf-plugins-core |
yumdownloader |
dnf download |
dnf-plugins-core |
repo-graph |
dnf repograph |
dnf-plugins-extras-repograph |
For a complete list of changes between YUM and DNF, please consult the
man page.
DNF in the future
Work continues on DNF. The tool improves with each bug fix and release. In the nearfuture, for example, fedup, the Fedora upgrade tool, is to be replaced with a DNF implementation. The implementation is already being tested and will be announced soon. In the meantime, if you do observe unexpected behaviour when using DNF, please file a bug so that the developers can look into it.
Eric Mesa
There used to be yum –skip-broken. Will there be something like that for DNF?
Rex Dieter
dnf ‘s default behavior is the equivalent of ‘yum –skip-broken’
Eric Mesa
Ah, I guess I didn’t understand what skip-broken really meant. I thought it was if one package wasn’t behaving I could still do a dnf update -y and it would complete and then show the ones it couldn’t update. Instead it just fails in that circumstance.
Pavlo Rudyi
Check also my article with more details: “DNF in Action — Practice Guide for Centos/RHEL/Fedora Package Manager” https://tlhp.cf/dnf-in-action-guide/
Dave Plaza
suggests that this is already the defaut behavior in the upgrade (what update aliases to) command:
liquidat
What about
. That was a real killer feature but does not work wit dnf.
Hiisi
What was the main reason of moving from yum to dnf?
Paul W. Frields
@Hiisi: One of the more compelling reasons was that yum had become an extremely convoluted codebase, especially in the dependency solver. There had also been advances in computing solutions like dependencies over the years. DNF was an opportunity to take those advances into account, and produce a more flexible and streamlined codebase for future maintenance. You can also read more here.
Sudhir Khanger
Can dnf also query packages? Like rpm -qa | dolphin. I only use most basic features of dnf but time to time I have to fall back to rpm.
Paul W. Frields
@Sudhir: You can do ‘dnf list installed’ and grep, or ‘dnf list installed \*glob\*’, just as with yum. However, rpm allows more fine grained query controls.
Leslie Satenstein
For a few weeks, my fingers entered dny instead of dnf.
I realized that my brain was saying Definitely Not Yum.
When dnf takes an automated action, for example, “skip broken”, I would like to know what is missing or causing dnf to opt out of the package or rpm file. I haven’t seen how to cause dnf to report why it did the “skip broken”
But after 6 months of dnf use, I must say that it is, performance wise, and in other ways, an improvement over “yum”.
andre-ghey
just wanted to mention, that the yum GUI) extender is now for dnf “yumex-dnf”
It is not stellar yet, but it is very useful.
A.
Kiiwi
For a while “dnf” for me has stood for “did not finish”. It has a tendency to break stuff. This message was sponsored by “rpm -Va”.