1.3.4 Using Yum Utilities to Manage Configuration

The yum-utils package includes several utilities that can help you to manage configuration and apply updates safely to your existing configuration. Most significant of these is yum-config-manager.

To install the yum-utils package:

# yum install -y yum-utils

You can use yum-config-manager to add repositories either at a specified URL, or within a specified repository file. For example, to add the legacy repository configuration file for Oracle Linux 7 from the Oracle Linux yum server:

# yum-config-manager --add-repo https://yum.oracle.com/public-yum-ol7.repo
Note

The legacy repository configuration file is unmaintained and deprecated. The information in this file may not be current and newer repositories may not be listed.

You can use the same command to automatically generate a repository configuration file for a valid yum repository, by pointing to the URL where the repository is hosted. For example, to create a new configuration file in /etc/repos.d for the Unbreakable Enterprise Kernel Release 5 repository. run:

# yum-config-manager --add-repo https://yum.oracle.com/repo/OracleLinux/OL7/UEKR5/x86_64

To enable a repository using yum-config-manager, use the --enable option. For example, to enable the ol7_addons repository, run:

# yum-config-manager --enable ol7_addons

You can use the --disable option in a similar way to disable a repository.

The yum-config-manager tool can also be used to set other configuration options using the --setopt and --save options. See the yum-config-manager(1) manual page for more information.

For a list of the tools included in the yum-utils package and a description of what these tools can do, see the yum-utils(1) manual page for more information.