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
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.
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.
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.
I see, thank you.
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
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
Today it’s already possible install using #yum install dnf
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