为什么dnf config-manager --save不起作用?

问题描述 投票:1回答:1

我想使用dnf config-manager为我的系统添加一个rpm仓库:

# dnf config-manager --add-repo=http://example.com/rpm-repo --setopt=gpgcheck=0 --save
Adding repo from: http://example.com/rpm-repo
# cat /etc/yum.repos.d/example.com_rpm-repo.repo
[example.com_rpm-repo]
name=created by dnf config-manager from http://example.com/rpm-repo
baseurl=http://example.com/rpm-repo
enabled=1

为什么生成的example.com_rpm-repo.repo文件不包含指定的选项:gpgcheck=0

环境:

# cat /etc/centos-release
CentOS Linux release 8.0.1905 (Core)
# yum list installed | grep dnf
dnf.noarch                          4.0.9.2-5.el8                     @System
dnf-data.noarch                     4.0.9.2-5.el8                     @System
dnf-plugins-core.noarch             4.0.2.2-3.el8                     @BaseOS
dnf-utils.noarch                    4.0.2.2-3.el8                     @BaseOS
libdnf.x86_64                       0.22.5-4.el8                      @System
python3-dnf.noarch                  4.0.9.2-5.el8                     @System
python3-dnf-plugins-core.noarch     4.0.2.2-3.el8                     @BaseOS
python3-libdnf.x86_64               0.22.5-4.el8                      @System
configuration centos rpm package-managers dnf
1个回答
0
投票

(很遗憾),您无法在单个操作中执行此操作。您首先需要创建存储库,然后设置选项:

dnf config-manager --add-repo=http://example.com/rpm-repo
dnf config-manager --save --setopt=gpgcheck=0 example.com_rpm-repo

是的,很遗憾,这意味着您需要了解重排,因此自动执行一项操作会有些复杂。

© www.soinside.com 2019 - 2024. All rights reserved.