← 返回命令列表

Linux command

dnf-config-manager 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Add

dnf config-manager --add-repo=[repository_url]

Print

dnf config-manager --dump

Enable

dnf config-manager --set-enabled [repository_id]

Disable

dnf config-manager --set-disabled [repository_id1] [repository_id2]

Set

dnf config-manager --setopt=[option]=[value]

说明

dnf config-manager provides command-line management of DNF repositories and configuration settings. It's part of dnf-plugins-core and offers an alternative to manually editing configuration files. The tool can add repositories from URLs (creating .repo files automatically), enable or disable existing repositories, and modify DNF configuration options on the fly. Changes to repositories are persisted in /etc/yum.repos.d/ as .repo files. This is particularly useful for scripted repository management, adding third-party repositories, or temporarily adjusting configuration without editing files manually. The --dump option is helpful for troubleshooting by showing the complete effective configuration.

参数

--add-repo _url_
Add repository from URL
--dump
Print current configuration
--set-enabled _repo_
Enable repository
--set-disabled _repo_
Disable repository
--setopt _opt=val_
Set configuration option
--save
Persist `--setopt` changes to the appropriate configuration file (by default changes are session-only).
--dump-variables
Print the effective values of the built-in DNF variables (`$releasever`, `$basearch`, …).
--help-cmd
Display help

FAQ

What is the dnf-config-manager command used for?

dnf config-manager provides command-line management of DNF repositories and configuration settings. It's part of dnf-plugins-core and offers an alternative to manually editing configuration files. The tool can add repositories from URLs (creating .repo files automatically), enable or disable existing repositories, and modify DNF configuration options on the fly. Changes to repositories are persisted in /etc/yum.repos.d/ as .repo files. This is particularly useful for scripted repository management, adding third-party repositories, or temporarily adjusting configuration without editing files manually. The --dump option is helpful for troubleshooting by showing the complete effective configuration.

How do I run a basic dnf-config-manager example?

Run `dnf config-manager --add-repo=[repository_url]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --add-repo _url_ do in dnf-config-manager?

Add repository from URL