centos 7.4 无法从 epel 安装“dnf”

centos 7.4 无法从 epel 安装“dnf”

这很奇怪,我有一个 centos7 VM 盒。尝试安装,dnf因为它是另一个包的依赖项。

互联网上的大部分说明都是这样的:

sudo yum install epel-release
sudo yum install dnf

但没有安装任何东西。No package dnf available

甚至关注了DNF博客: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

仍然没有安装

# 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

我该如何安装 dnf?我认为这应该是一件小事。我做错了什么?

答案1

警告:EPEL 7 DNF 非常老旧,存在安全漏洞等问题。这似乎是它被删除的原因。话虽如此,以下是让它在 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

答案2

这将在 CentOS/7 上安装 dnf-0.6.4。

curl -OL https://raw.githubusercontent.com/tamama/repository/master/sh/tamama/node-provisioning/tamama-centos/7.3/setup.sh
sudo sh setup.sh

相关内容