How To Install DNF Package Manager In CentOS/RHEL

DNF, or Dandified Yum, which is the next major version of the Yum package manager was introduced with Fedora 18. As of Fedora 22, it has become the default package manager.

As you may know, the Fedora Linux operating system is essentially a bleeding edge testing ground for packages that may be included in RHEL/CentOS based distributions in the future.

It is therefore likely that in some future release, RHEL/CentOS will also make use of DNF rather than Yum to take advantage of the new features, so let’s take a look at what’s involved in installing and using DNF in CentOS Linux so that we can be ready for it when it’s made default.

DNF aims to address poor performance and high memory usage associated with Yum.

Installing DNF

Currently the DNF package comes from the EPEL repository, so if your Linux system is not already configured to use this repository, simply run the command below to set it up.

[[email protected] ~]# yum install epel-release -y

Now that EPEL is ready to use, simply install the dnf package as shown below.

[[email protected] ~]# yum install dnf -y

So we’re using a package manager to install a package manager, kind of meta. I was wondering if DNF would attempt to remove Yum during installation, but it did not and it appears that they are capable of working along side each other.

Using DNF

Now that DNF is installed we can use it in place of Yum. Most of the commands appear to be of the same syntax which makes things much easier, for example:

Installing a package

dnf install httpd

Updating a package

dnf update httpd

Viewing history

dnf history

Uninstall a package

dnf remove httpd

Check out the man page for further information.


We have seen how we can easily install DNF in CentOS/RHEL distributions of Linux, allowing us to get used to working with it before it inevitably replaces Yum in some future update, as it has already done in Fedora 22.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>