Home CentOS How To Install DNF On CentOS 7

How To Install DNF On CentOS 7

By sk
Published: Last Updated on 88.3K views

DNF (short for “DaNdiFied Yum”) is the next upcoming major version of Yum, a package manager for RPM-based Linux distributions, such as RHEL, CentOS, and Fedora. DNF is first introduced in Fedora 18, and it has became the default package manager from Fedora 25 version. This brief tutorial will explain how to install DNF on CentOS 7 and RHEL 7 versions.

Install DNF On CentOS 7

Update:

DNF is available in the official repositories of RHEL 7 and CentOS. To install DNF on CentOS 7, simply run the following command as root user:

# yum install dnf

I know DNF is not available yet in the default repositories of CentOS 7. But, I wasn't aware that DNF is not available in the EPEL repository too.

When I tried try to install DNF from EPEL, I got this error:

# yum install dnf
 Loaded plugins: fastestmirror
 Loading mirror speeds from cached hostfile
 * base: ftp.iitm.ac.in
 * elrepo: elrepo.mirror.angkasa.id
 * epel: kartolo.sby.datautama.net.id
 * extras: ftp.iitm.ac.in
 * updates: ftp.iitm.ac.in
 Nothing to do

See? DNF is not available in EPEL anymore. After a few google searches, I found the work around in Serverfault forum. The reason of the DNF removal from EPEL repository is EPEL 7 DNF is very old and has issues to include security flaws. This is why DNF was removed from EPEL.

Thankfully, DNF and its dependencies are available at Springdale Linux (SDL) repository. This repository is being maintained by the members of the computing staff of Princeton University and the Institute for Advanced Study.

Let us download DNF and its dependencies using commands:

# wget http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64//dnf-0.6.4-2.sdl7.noarch.rpm
# wget http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64/dnf-conf-0.6.4-2.sdl7.noarch.rpm
# wget http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64/python-dnf-0.6.4-2.sdl7.noarch.rpm

Then, install DNF using command:

# yum install dnf-0.6.4-2.sdl7.noarch.rpm dnf-conf-0.6.4-2.sdl7.noarch.rpm python-dnf-0.6.4-2.sdl7.noarch.rpm

Now start using DNF. To get your hands on DNF, refer the help section by running the following command.

# dnf help

A word of caution: Please be mindful that the packages from the above mentioned link are unsupported and not included in the stock RedHat installation. These unsupported packages may not be updated frequently or maintained. Use them at your own risk.


New to DNF? Read our next article to know how to use DNF package manager.

Reference:

You May Also Like

9 comments

Iman February 10, 2018 - 11:59 am

Thanks

Reply
Earl Higgins March 5, 2018 - 9:55 pm

This might not be the forum to ask, but I am wondering if anyone knows if there is a reason why modern versions of Centos 7 do not include DNF, given how it has been available in mainstream Fedora for nearly 3 years.

Reply
Max Power August 23, 2018 - 9:26 pm

CentOS is downstream from Red Hat Enteprise Linux, which is still using yum as well. It’s expected that RHEL will include dnf in version 8 which means CentOS will likely include it in version 8 as well.

Reply
Earl Higgins November 27, 2018 - 2:55 am

I see, thank you.

Reply
IC November 21, 2018 - 7:25 pm

10Q !

Reply
louis December 4, 2019 - 3:05 am

Instructions fail…—> Package python-dnf.noarch 0:0.6.4-2.sdl7 will be installed
–> Processing Dependency: python-libcomps >= 0.1.6 for package: python-dnf-0.6.4-2.sdl7.noarch
–> Finished Dependency Resolution
Error: Package: python-dnf-0.6.4-2.sdl7.noarch (/python-dnf-0.6.4-2.sdl7.noarch)
Requires: python-libcomps >= 0.1.6

Reply
Shawn December 9, 2019 - 9:24 pm

You need all these rpms(5 total) including the dependencies and run the install:
yum install dnf-0.6.4-2.sdl7.noarch.rpm dnf-conf-0.6.4-2.sdl7.noarch.rpm python2-libcomps-0.1.8-12.el7.x86_64.rpm python-dnf-0.6.4-2.sdl7.noarch.rpm libcomps-0.1.8-12.el7.x86_64.rpm

Reply
Daniel January 14, 2020 - 5:29 pm

Today it’s already possible install using #yum install dnf

Reply
Alvin October 1, 2020 - 3:43 am

still not working for me [root@CSCentOS06 ~]# yum install dnf
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: repos.hou.layerhost.com
* epel: sjc.edge.kernel.org
* extras: repos.lax.quadranet.com
* updates: mirror.pit.teraswitch.com
No package dnf available.
Error: Nothing to do
[root@CSCentOS06 ~]#

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More