dnf
我想使用和安装包copr
。copr-cli
和dnf-plugins-core
都已安装。 但dnf
显示copr
不存在:
$> sudo dnf install dnf-plugins-core
Using metadata from Wed Jan 18 12:48:19 2017
Package dnf-plugins-core-0.1.5-3.el7.noarch is already installed, skipping.
Package dnf-plugins-core-0.1.5-3.el7.noarch is already installed, skipping.
Dependencies resolved.
Nothing to do.
$> sudo dnf copr (stuff)
No such command: copr. Please use /usr/bin/dnf --help
It could be a DNF plugin command.
dnf-plugins-copr
尝试自行安装也会失败:
$> sudo dnf install dnf-plugins-copr
Using metadata from Wed Jan 18 12:48:19 2017
No package dnf-plugins-copr available.
Error: no package matched: dnf-plugins-copr
我必须先启用其他存储库吗?我正在使用 RHEL 7.3。
答案1
事实上,在 CentOS 7 上,DNF 在 EPEL7 仓库中太旧了(版本 0.6.x)。按照这些说明操作;它们将解决问题。 来源:适用于 RHEL 7 和 CentOS 7 的 Fresh DNF
摘自此博客:
为了在 RHEL 7 或 CentOS 7 中获取 DNF-1.1.9:启用 EPEL 存储库以获取其他 DNF 依赖项:
# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# sudo rpm -Uvh epel-release-latest-7*.rpm
添加 DNF 堆栈存储库:
# cat <<EOF > /etc/yum.repos.d/dnf-centos.repo
[dnf-centos]
name=Copr repo for dnf-centos owned by @rpm-software-management
baseurl=https://copr-be.cloud.fedoraproject.org/results/@rpm-software-management/dnf-centos/epel-7-\$basearch/
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/@rpm-software-management/dnf-centos/pubkey.gpg
enabled=1
enabled_metadata=1
EOF
安装 DNF:
# yum install dnf
检查您是否拥有正确的版本:
# dnf --version
1.1.9
Installed: dnf-0:1.1.9_1-16ge900fce.el7.centos.noarch at 2017-02-20 08:57
Built : at 2016-07-01 10:56
Installed: rpm-0:4.11.3-21.el7.x86_64 at 2017-02-20 08:03
Built : CentOS BuildSystem <http://bugs.centos.org> at 2016-11-05 23:37