Saturday, November 7, 2015

Managing packages on Fedora with DNF

http://fedoramagazine.org/managing-packages-fedora-dnf

dnf-help 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 yum2dnf 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.

No comments:

Post a Comment