9장. Managing custom software repositories


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

The /etc/dnf/dnf.conf file contains the [main] section and can contain one or more repository sections with a unique repository ID in brackets ([]), for example, ([<repository-ID>]). You can use these sections to define individual DNF repositories by setting repository-specific options. Note that repository IDs must be unique. The values you define in individual repository sections of the /etc/dnf/dnf.conf file override values set in the [main] section for this repository.

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

Consider adding your custom repositories in separate .repo files instead of the /etc/dnf/dnf.conf DNF configuration file to avoid possible issues if other programs modify the DNF configuration file.

You can add the DNF repository to your system by using the dnf config-manager --add-repo command. Repositories that you add with this command are enabled by default. However, you can also use the dnf config-manager command to disable the repository.

주의

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.

Procedure

  1. Add a repository to your system:

    # dnf config-manager --add-repo <repository_URL>
  2. Review and, optionally, update the repository settings that the previous command created in the /etc/yum.repos.d/<repository_URL>.repo file:

    # cat /etc/yum.repos.d/<repository_URL>.repo
  3. Optional: Disable the DNF repository added to your system:

    # dnf config-manager --disable <repository_ID>

    To re-enable the repository, enter:

    # dnf config-manager --enable <repository_ID>
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2026 Red Hat
맨 위로 이동