Chapter 10. Managing custom software repositories


You can configure a repository in the /etc/yum.conf file. or in a .repo file in the /etc/yum.repos.d/ directory.

Note

It is recommended to define your repositories in the new or existing .repo file in /etc/yum.repos.d/ because all files with the .repo file extension are read by YUM.

The /etc/yum.conf file contains the [main] sections and can contain one or more repository sections ([<repository_ID>]) that you can use to set repository-specific options. The values you define in individual repository sections of the /etc/yum.conf file override values set in the [main] section.

10.1. YUM repository options

The /etc/yum.conf configuration file contains the repository sections with a repository ID in brackets ([<repository_ID>]). You can use these sections to define individual YUM repositories.

Important

Repository IDs must be unique.

For a complete list of available repository ID options, see the [<repository_ID>] OPTIONS section of the dnf.conf(5) man page on your system.

10.2. Adding a YUM repository

You can add a YUM repository to your system by defining it in the .repo file in the /etc/yum.repos.d/ directory.

Procedure

  1. Add a repository to your system:

    # yum-config-manager --add-repo <repository_URL>
    Copy to Clipboard Toggle word wrap

    Note that repositories added by this command are enabled by default.

  2. Review and, optionally, update the repository settings that the previous command has created in the /etc/yum.repos.d/<repository_URL>.repo file:

    # cat /etc/yum.repos.d/<repository_URL>.repo
    Copy to Clipboard Toggle word wrap
Warning

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

10.3. Enabling a YUM repository

Once you added a YUM repository to your system, enable it to ensure installation and updates.

Procedure

  • Enable a repository:

    # yum-config-manager --enable <repository_id>
    Copy to Clipboard Toggle word wrap

10.4. Disabling a YUM repository

To to prevent particular packages from installation or update, you can disable a YUM repository that contains these packages.

Procedure

  • Disable a repository:

    # yum-config-manager --disable <repository_id>
    Copy to Clipboard Toggle word wrap
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat