Chapter 10. Managing custom software repositories

The configuration information for YUM and related utilities are stored in the /etc/yum.conf file. This file contains one or more [repository] sections, which allow you to set repository-specific options.

It is recommended to define individual repositories in new or existing .repo files in the /etc/yum.repos.d/ directory.

Note that the values you define in individual [repository] sections of the /etc/yum.conf file override values set in the [main] section.

The following sections describe how to manage custom software repositories in Red Hat Enterprise Linux 9:

10.1. Setting yum repository options

The /etc/yum.conf configuration file contains the [repository] sections, where repository is a unique repository ID. The [repository] sections allow you to define individual YUM repositories.

Note

Do not give custom repositories names used by the Red Hat repositories to avoid conflicts.

For a complete list of available [repository] options, see the [repository] OPTIONS section of the yum.conf(5) man page.

10.2. Adding a yum repository

To define a new repository, you can either:

  • Add a [repository] section to the /etc/yum.conf file.
  • Add a [repository] section to a .repo file in the /etc/yum.repos.d/ directory.

    YUM repositories commonly provide their own .repo file.

Note

It is recommended to define your repositories in a .repo file instead of /etc/yum.conf as all files with the .repo file extension in this directory are read by yum.

The following procedure describes how to add a yum repository to your system.

Procedure

  • To add a repository to your system, use:

    # yum config-manager --add-repo repository_URL

    Replace repository_url with URL pointing to the repository.

Warning

Obtaining and installing software packages from unverified or untrusted sources other than Red Hat certificate-based Content Delivery Network (CDN) constitutes a potential security risk, and could lead to security, stability, compatibility, and maintainability issues.

10.3. Enabling a yum repository

The following procedure describes how to enable a yum repository added to your system.

Procedure

  • To enable a repository, use:

    # yum-config-manager --enable repositoryID

    Replace repositoryID with the unique repository ID.

To list available repository IDs, see Listing software packages.

10.4. Disabling a yum repository

The following procedure describes how to disable a yum repository added to your system.

Procedure

  • To disable a yum repository, use:

    # yum-config-manager --disable repositoryID

    Replace repositoryID with the unique repository ID.

To list available repository IDs, see Listing software packages.