Linux command
yum-config-manager 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
View
yum-config-manager
Add a repository
yum-config-manager --add-repo [url_or_path]
Enable
yum-config-manager --enable [repo_id]
Disable
yum-config-manager --disable [repo_id]
Set
yum-config-manager --setopt=[repo_id.option=value] --save
说明
yum-config-manager is a utility for managing the main yum configuration and its repositories. It can display current settings, toggle which repositories are enabled, add new repositories from URLs or .repo files, and adjust individual options without manually editing `/etc/yum.conf` or files under `/etc/yum.repos.d/`. On modern Red Hat-based distributions (RHEL 8+, Fedora, CentOS Stream), yum has been replaced by dnf, and this command is typically provided as an alias or wrapper for `dnf config-manager`.
参数
- -h, --help
- Display help information.
- --save
- Save the current options (useful with --setopt).
- --enable
- Enable the specified repositories (automatically saves).
- --disable
- Disable the specified repositories (automatically saves).
- --add-repo=_URL_|_FILE_
- Add (and enable) a repository from the given .repo file or URL.
- --setopt=_option_=_value_
- Set any config option in yum config or repo files. Use _repoid.option=value_ for repo-specific options; _repoid_ may contain wildcards.
FAQ
What is the yum-config-manager command used for?
yum-config-manager is a utility for managing the main yum configuration and its repositories. It can display current settings, toggle which repositories are enabled, add new repositories from URLs or .repo files, and adjust individual options without manually editing `/etc/yum.conf` or files under `/etc/yum.repos.d/`. On modern Red Hat-based distributions (RHEL 8+, Fedora, CentOS Stream), yum has been replaced by dnf, and this command is typically provided as an alias or wrapper for `dnf config-manager`.
How do I run a basic yum-config-manager example?
Run `yum-config-manager` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -h, --help do in yum-config-manager?
Display help information.