yum-config-manager
Manage yum repository configuration
TLDR
View documentation for the original command
SYNOPSIS
yum-config-manager [OPTIONS] [REPOSITORIES...]
PARAMETERS
--add-repo=URL
Adds a new repository definition from the specified URL to the system's configuration. The URL should point to a .repo file.
--disable=REPOID
Disables the specified repository or a comma-separated list of repository IDs. Wildcards are supported.
--enable=REPOID
Enables the specified repository or a comma-separated list of repository IDs. Wildcards are supported.
--setopt=OPTION=VALUE
Sets a specific option for a repository or globally. E.g., --setopt=reponame.enabled=0 or --setopt=timeout=120.
--save
Saves the current configuration changes to the respective .repo files, making them persistent across reboots.
--dump
Displays the current repository configuration, including enabled/disabled status and other options, without making changes.
--all-enablerepo
Enables all currently configured repositories.
--all-disablerepo
Disables all currently configured repositories.
DESCRIPTION
The yum-config-manager command, part of the yum-utils package, provides a convenient way to manage Yum and DNF repository configurations. It allows users to enable or disable repositories, add new ones, and modify various repository options directly from the command line. This command primarily manipulates the .repo files located in /etc/yum.repos.d/, making it an essential tool for system administrators to control where their systems retrieve software packages. While originally designed for Yum, on modern systems it often acts as an alias or wrapper for dnf config-manager, adapting to the DNF package manager.
CAVEATS
On modern Red Hat based systems (e.g., RHEL 8+, Fedora), yum-config-manager is typically an alias or symlink to dnf config-manager. For new scripts or configurations, it's generally recommended to use dnf config-manager directly if DNF is the primary package manager.
This command requires root privileges to modify system-wide repository configurations. Ensure you understand the source and trustworthiness of any new repositories added, as they can significantly impact system security and stability.
COMMON USE CASES
Enabling a specific repository: sudo yum-config-manager --enable epel
Disabling a specific repository: sudo yum-config-manager --disable updates
Adding a new repository from a URL: sudo yum-config-manager --add-repo https://download.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm (Note: This URL points to an RPM that provides the .repo file)
Viewing current repository configurations: yum-config-manager --dump
HISTORY
yum-config-manager originated as part of the yum-utils package, which provided various utilities to complement the Yum package manager. Its primary role was to simplify the management of repository configuration files, often found in /etc/yum.repos.d/. With the widespread adoption of DNF as the default package manager in newer Linux distributions (starting with Fedora and later RHEL 8), the functionality was largely mirrored in dnf-config-manager. Consequently, yum-config-manager often became a compatibility wrapper or an alias, ensuring continuity for existing scripts and user familiarity during the transition.
SEE ALSO
yum(8), dnf(8), dnf-config-manager(8), repoquery(1), yum-utils(7)