Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 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.
Define your repositories in the .repo
file instead of /etc/dnf/dnf.conf
.
The /etc/dnf/dnf.conf
file contains the [main]
section 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/dnf/dnf.conf
file override values set in the [main]
section.
9.1. DNF repository options Copier lienLien copié sur presse-papiers!
The /etc/dnf/dnf.conf
configuration file contains repository sections with a unique repository ID in brackets ([]
). You can use such sections to define individual DNF repositories.
Repository IDs in []
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.
9.2. Adding a DNF repository Copier lienLien copié sur presse-papiers!
You can add a DNF repository to your system by using the dnf config-manager --add-repo
command.
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
Add a repository to your system:
dnf config-manager --add-repo <repository_URL>
# dnf config-manager --add-repo <repository_URL>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note that repositories added by this command are enabled by default.
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
# cat /etc/yum.repos.d/<repository_URL>.repo
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
9.3. Enabling a DNF repository Copier lienLien copié sur presse-papiers!
You can enable a DNF repository added to your system by using the dnf config-manager
command.
Procedure
Enable a repository:
dnf config-manager --enable <repository_ID>
# dnf config-manager --enable <repository_ID>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
9.4. Disabling a DNF repository Copier lienLien copié sur presse-papiers!
You can disable a DNF repository added to your system by using the dnf config-manager
command.
Procedure
Disable a repository:
dnf config-manager --disable <repository_ID>
# dnf config-manager --disable <repository_ID>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow