8

It is so weird, I have a centos7 VM box. Try to install dnf because it is a dependency of another package.

Most instructions on internet is like this:

sudo yum install epel-release
sudo yum install dnf

But nothing installs. No package dnf available

Even followed DNF blog: http://dnf.baseurl.org/2016/07/01/fresh-dnf-for-rhel-7-and-centos-7/

# cat <<EOF > /etc/yum.repos.d/dnf-stack-el7.repo
[dnf-stack-el7]
name=Copr repo for dnf-stack-el7 owned by @rpm-software-management
baseurl=https://copr-be.cloud.fedoraproject.org/results/@rpm-software-management/dnf-stack-el7/epel-7-\$basearch/
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/@rpm-software-management/dnf-stack-el7/pubkey.gpg
enabled=1
enabled_metadata=1

Still nothing installs

# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)

# yum search dnf
Loading mirror speeds from cached hostfile
 * base: centos.bhs.mirrors.ovh.net
 * epel: mirror.umd.edu
 * extras: centos.bhs.mirrors.ovh.net
 * remi-safe: remi.mirror.ate.info
 * updates: centos.bhs.mirrors.ovh.net
========================================================================= N/S matched: dnf ==========================================================================
dnf-langpacks.noarch : Langpacks plugin for dnf
dnf-langpacks-conf.noarch : Configuration file for DNF Langpacks plugin
etckeeper-dnf.noarch : DNF plugin for etckeeper support
python-dnf-langpacks.noarch : Langpacks plugin for dnf-2
mirrormanager2-mirrorlist.noarch : MirrorList serving mirrors to yum/dnf

How can I install dnf? I assume this should be a trivial task. What have I done wrong?

  • python3-dnf has been retired from EPEL 7 which breaks dnf. I'm digging into other solutions aside from epel. Will post an answer when I find a reasonable solution. – Michael Hobbs Sep 19 '17 at 17:00
  • @MichaelHobbs I gather from your lack of posting, that there is no reasonable solution?😢 – Philippe Apr 22 at 15:28
4

WARNING: EPEL 7 DNF is very old and has issues to include security flaws. This appears to be the reason it was removed. That said here is the work around to get it working on Centos 7.

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//dnf-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
yum install python-dnf-0.6.4-2.sdl7.noarch.rpm  dnf-0.6.4-2.sdl7.noarch.rpm dnf-conf-0.6.4-2.sdl7.noarch.rpm
| improve this answer | |
  • Okay, I give up. DNF was quite a buzz last year but removed from centos epel silently. I stop using anything that dependent on DNF. – Reed Sep 19 '17 at 18:52
  • 1
    When I have some time latter will update the answer to include how to build the newest version of dnf. While looking at a build option, the build instruction require you have dnf installed to build dnf. Really? – Michael Hobbs Sep 20 '17 at 18:48
  • I get Error: Package: python2-libcomps-0.1.8-3.el7.x86_64 (epel) Requires: libcomps(x86-64) = 0.1.8-3.el7 – vabada Oct 10 '17 at 11:54
2

This will install dnf-0.6.4 on CentOS/7.

curl -OL https://raw.githubusercontent.com/tamama/repository/master/sh/tamama/node-provisioning/tamama-centos/7.3/setup.sh
sudo sh setup.sh
| improve this answer | |
  • 2
    "curl this random shell script to your production server and run it as root" – Jonathan Landrum Jul 16 '19 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.