Product SiteDocumentation Site

6.3.2. Setting [repository] Options

The [repository] sections, where repository is a unique repository ID such as my_personal_repo (spaces are not permitted), allow you to define individual DNF repositories.
The following is a bare-minimum example of the form a [repository] section takes:
[repository]
name=repository_name
baseurl=repository_url
Every [repository] section must contain the following directives:
name=repository_name
…where repository_name is a human-readable string describing the repository.
parameter=repository_url
…where parameter is one of the following: baseurl, metalink, or mirrorlist;
…where repository_url is a URL to a directory containing a repodata directory of a repository, a metalink file, or a mirror list file.
  • If the repository is available over HTTP, use: http://path/to/repo
  • If the repository is available over FTP, use: ftp://path/to/repo
  • If the repository is local to the machine, use: file:///path/to/local/repo
  • If a specific online repository requires basic HTTP authentication, you can specify your user name and password by prepending it to the URL as username:password@link. For example, if a repository on http://www.example.com/repo/ requires a username of user and a password of password, then the baseurl link could be specified as http://user:password@www.example.com/repo/.
Usually this URL is an HTTP link, such as:
baseurl=http://path/to/repo/releases/$releasever/server/$basearch/os/
Note that DNF always expands the $releasever, $arch, and $basearch variables in URLs. For more information about DNF variables, refer to Section 6.3.3, “Using DNF Variables”.
To configure the default set of repositories, use the enabled option as follows:
enabled=value
…where value is one of:
0 — Do not include this repository as a package source when performing updates and installs.
1 — Include this repository as a package source.
Turning repositories on and off can also be performed by passing either the --set-enabled repo_name or --set-disabled repo_name option to the dnf command, or through the Add/Remove Software window of the PackageKit utility.
Many more [repository] options exist. For a complete list, refer to the [repository] OPTIONS section of the dnf.conf(5) manual page.