Introduction

We have been using the yum or rpm package management tools for a while for managing packages in Redhat, Centos and other distributions which have been forked from RHEL.
Yum has been the default package manager since Redhat Enterprise Linux 5 onwards. Before yum, RHEL systems had been using the up2date software management program.
The DNF package manager was introduced in Fedora 18 and became the default package manager for the Fedora distribution for operating system version Fedora 22 onwards and is intended to be a replacement for yum.

In this article, we will compare these package managers to provide some perspective as to when and why you should consider using one over the other.

 

Sno                   DNF              YUM                                    RPM
1Written in C and PythonWritten in pythonWritten in C and Perl
2DNFs uses libsolv for dependency resolution which was created and maintained by SUSEYUM uses public API for dependency resolutionRPM does not provide dependency resolution
3Dependency resolution is fast and easy making installation of groups of packages very simpleDependency resolution is slower as compared to dnf but is still fairly straightforwardDue to lack of dependency resolution installation of software applications having multiple dependency requirements is very tedious
Does not require dependent packages to be available locallyDoes not require dependent packages to be available locallySince rpm cannot resolve dependencies on its own, it needs all dependent packages for a package to be available locally on the system in the same folder as that of the concerned package
4DNF supports more extensionYUM support only Python for extensionRPM functionality can be extended somewhat using C
5Multiple packages can be installed with a single commandMultiple packages can be installed with a single commandCan be used to install multiple .rpm package files in a single command provided there are no dependency issues
6DNF has a well-documented API making adding new features easyBuilding new features in yum is not as straightforwardBoth yum and dnf use rpm under the hood for underlying package management operations
Can connect to online or remote repositories to search for packagesCan connect to online or remote repositories to search for packagesRpm tool cannot connect to online repositories
7DNF uses lower memory reduction and less automatic synchronization of metadata with repositoriesYUM uses high memory reduction and automatic synchronization of metadata with repositoriesNot applicable since rpm does not provide the ability to connect to online repositories
8DNF allows all installed packages to be updated with a single command: dnf updateYUM allows all installed packages to be updated with a single command: yum updateRPM does not provide this feature. To update a .rpm package using RPM, the updated .rpm file for the concerned package must be available locally on the system. To update the package, use rpm -Uvh <.rpm file name>
9If a package has unmet dependencies during a dnf update action, that package will not be updated.With yum it is possible to update to a package that has unmet dependencies using the –skip-broken optionA package update using rpm will fail if any package dependency has not been met
10If enabled repository does not respond, dnf will skip it and continue the transaction with the available reposYUM will not proceed if a repository is unavailableNA
11dnf update and dnf upgrade are equivalentyum upgrade Is the same as the yum update command with the –obsoletes flag setNA
12Dependencies are not upgraded on package installationIt is possible to upgrade dependencies during package installation while using yumRPM requires that a compatible version of the dependent package be available on the system. It will install an updated dependent package provided there are no compatibility issues
13Clean on remove: When removing a package, dnf will automatically remove any dependent packages that were not explicitly installed by the user.Yum will not remove dependencies during package removalRpm will not remove dependencies during package removal
14kernel packages are not protected by dnf meaning you can remove all kernel packages, including the running packageYum will not allow this behaviorRpm will error out if you try to remove the kernel package since other packages are dependent on it
15DNF uses separate libraries for interacting with repositories and dependency resolutionYum does not use separate libraries for such functionsNA
16Allows parallel operationsDoes not allow parallel operationsAllows parallel operations
17Can work with both python versions 2 and 3Compatible with python version 2 onlyDoes not rely on python
18Default package manager for FedoraDefault package manager for most Redhat based distributionsInstalled by default on almost all Redhat based distributions

 

Conclusion

In this article, we compared the different features of the three package management software. We hope that this information helps you understand and determine why one or more of the three package managers would be best suited for which scenarios.

The following two tabs change content below.

Sahil Suri

He started his career in IT in 2011 as a system administrator. He has since worked with HP-UX, Solaris and Linux operating systems along with exposure to high availability and virtualization solutions. He has a keen interest in shell, Python and Perl scripting and is learning the ropes on AWS cloud, DevOps tools, and methodologies. He enjoys sharing the knowledge he's gained over the years with the rest of the community.