Configuration 为什么dnf配置管理器--save不起作用?

Configuration 为什么dnf配置管理器--save不起作用?,configuration,centos,rpm,package-managers,dnf,Configuration,Centos,Rpm,Package Managers,Dnf,我想使用dnf配置管理器为我的系统添加rpm repo: 为什么生成的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

我想使用dnf配置管理器为我的系统添加rpm repo:

为什么生成的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
(遗憾的是)您无法在一次操作中完成此操作。您首先需要创建存储库,然后设置选项:

是的,遗憾的是,这意味着您需要知道repoid,因此要将其自动化为一个操作将有点复杂

# 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
dnf config-manager --add-repo=http://example.com/rpm-repo
dnf config-manager --save --setopt=gpgcheck=0 example.com_rpm-repo