What is DNF ?
DNF, or Dandified Yum, was introduced with Fedora 18 as the next major version of the Yum package manager. It has become the default package manager since Fedora 22.
The Fedora Linux operating system, as you may know, is essentially a bleeding edge testing ground for packages that could be included in future distributions based on RHEL / CentOS.
Therefore, it is likely that in some future release, RHEL / CentOS will also use DNF instead of Yum to take advantage of the new features, so let’s look at what’s involved in installing and using DNF in CentOS Linux so we can be ready for it when it’s made by default.
DNF is aimed at addressing Yum’s poor performance and high memory usage.
The DNF package comes from the EPEL repository, so if your Linux system is not already configured to use this repository, simply execute the following command to set it up.
yum install epel-release -y
Now that EPEL is ready to use, just install dnf as shown below.
yum install dnf -y
How to Use DNF commands
We can use it instead of Yum now that DNF is installed. Most commands seem to have the same syntax that makes things much easier, such as:
Installing a package
dnf install httpd
Updating a package
dnf update httpd
Removing a package
dnf remove httpd
We saw how we can easily install DNF in Linux’s CentOS / RHEL distributions, allowing us to get used to working with it before it inevitably replaces Yum in some future update, as it did in Fedora 22.