What is the difference between DNF and YUM?

Yum Package Manager has been replaced by DNF Package Manager since many long-standing issues in Yum remain unresolved.

These problems include poor performance, excessive memory usage, slowdown for dependency resolution.

DNF uses “libsolv” for dependency resolution, developed and maintained by SUSE to improve performance.

It was written mostly in python, and it has its own way of coping with dependency resolution.

Its API is not fully documented, and its extension system only allows Python plugins.

Yum is a front-end tool for rpm that manages dependencies and repositories and then uses RPM to install, download and remove packages.

Both are used to manage packages on the rpm-based system (such as Red Hat, CentOS and Fedora), including installation, upgrade, search and remove.

Why would they want to build a new tool instead of fixing existing problems?

Ales Kozamblak explained that fixing issues was not technically feasible and that the yum team was not ready to accept the changes immediately.

Also, the big challenge is that there are 56K lines for yum, but only 29K lines for DNF, so there is no way to fix it, except the fork.

However yum was working fine and it was a default package management tool until RHEL/CentOS 7.

S.NoDNF (Dandified YUM)YUM (Yellowdog Updater, Modified)
1DNF uses ‘libsolv’ for dependency resolution, developed and maintained by SUSE.YUM uses the public API for dependency resolution
2API is fully documentedAPI is not fully documented
3It is written in C, C++, PythonIt is written only in Python
4DNF is currently used in Fedora, Red Hat Enterprise Linux 8 (RHEL), CentOS 8, OEL 8 and Mageia 6/7.YUM is currently used in Red Hat Enterprise Linux 6/7 (RHEL), CentOS 6/7, OEL 6/7.
5DNf supports various extensionsYum supports only Python-based extension
6The API is well documented so it’s easy to create new featuresIt is very difficult to create new features because the API is not properly documented.
7The DNF uses less memory when synchronizing the metadata of the repositories.The YUM uses excessive memory when synchronizing the metadata of the repositories.
8DNF uses a satisfiability algorithm to solve dependency resolution (It’s using a dictionary approach to store and retrieve package and dependency information).Yum dependency resolution gets sluggish due to public API.
9All performance is good in terms of memory usage and dependency resolution of repository metadata.Overall performance is poor in terms of many factors.
10DNF Update: If a package contains irrelevant dependencies during a DNF update process, the package will not be updated.YUM will update a package without verifying this.
S.NoDNF (Dandified YUM)YUM (Yellowdog Updater, Modified)
11If the enabled repository does not respond, dnf will skip it and continue the transaction with the available repositories.If a repository is not available, YUM will stop immediately.
12dnf update and dnf upgrade are equals.It’s different in yum
13The dependencies on package installation are not updatedYum offered an option for this behavior
14Clean-up Package Removal: When removing a package, dnf automatically removes any dependency packages not explicitly installed by the user.Yum didn’t do this
15Repo Cache Update Schedule: By default, ten minutes after the system boots, updates to configured repositories are checked by dnf hourly. This action is controlled by the system timer unit named “/usr/lib/systemd/system/dnf-makecache.timer”.Yum do this too.
16Kernel packages are not protected by dnf. Unlike Yum, you can delete all kernel packages, including one that runs.Yum will not allow you to remove the running kernel
17libsolv: for solving packages and reading repositories.

hawkey: hawkey, library providing simplified C and Python API to libsolv.

librepo: library providing C and Python (libcURL like) API for downloading linux repository metadata and packages.

libcomps: Libcomps is alternative for yum.comps library. It’s written in pure C as library and there’s bindings for python2 and python3
Yum does not use separate libraries to perform this function.
18DNF contains 29k lines of codeYum contains 56k lines of code
19DNF was developed by Ales KozumplikYUM was developed by Zdenek Pavlas, Jan Silhan and team members

About Magesh Maruthamuthu

Love to play with all Linux distribution

View all posts by Magesh Maruthamuthu

4 Comments on “What is the difference between DNF and YUM?”

  1. I am really tired of finding always new names for software functions which are more or less the same just changing release version of Linux. What do you think that we are doing during our days? Just re-learning to use the different packages to accomplish the same tasks? BTW the Gnome interface in Centos 8 is perhaps the worse Graphical environment I ever saw in my professional life!

    1. Alessandro

      I kind of hear you on that – thing is this is the price to be paid for used open software. You are not compelled to use dnf, you can stick to yum or even rpm itself, if you choose, at the expense of convenience, performance and complexity. Additionally, if you don’t like Gnome, and I don’t much care for it though it has grown on me somewhat and is fine to use, simply find a GUI you like. I like KDE Plasma, but that is just one of many options. Play around – try Mate or Cinammon, or even, for an efficient and lightweight experience, Xfce…

Leave a Reply

Your email address will not be published. Required fields are marked *