1.2.4 Using the DNF config-manager Plugin

The dnf-plugins-core package includes several utilities that can help you to manage configuration and safely apply updates to your existing configuration. Most significant of these is the dnf config-manager plugin.

You can use dnf config-manager to add repositories, either at a specified URL or within a specified repository file. For example, to add a repository configuration file for Oracle Linux 8 that is hosted on a remote server, you can run the following command:

# dnf config-manager --add-repo https://example.com/my_yum_config.repo

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

# dnf config-manager --add-repo https://example.com/repo/OracleLinux/OL8/myrepo/x86_64

To enable a repository by using dnf config-manager, use the --enable option. For example, to enable the ol8_appstream repository, run:

# dnf config-manager --enable ol8_appstream

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

You can also use the dnf config-manager tool to set other configuration options by specifying the --setopt and --save options. See the dnf.plugin.config_manager(8) manual page for more information.