Skip to content

Repository Configuration

Oliver Kurth edited this page Dec 9, 2022 · 4 revisions

Repository Configuration

The repository config file resides in /etc/yum.repos.d unless otherwise configured. A typical repo file looks like this:

[photon-release]
name=VMware Photon Linux $releasever ($basearch)
baseurl=https://packages.vmware.com/photon/$releasever/photon_release_$releasever_$basearch
gpgkey=file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY
gpgcheck=1
enabled=1
skip_if_unavailable=True

There can be multiple repositories configured in one repo config file, each one in its own section with their id (photon-release in the example above).

baseurl

Type: list

Default: none

The base url(s) for the repository. This points to the location where the repodata reside. Allowed protocols are http:, https:, ftp:, ftps: and file:.

Since version 3.4: multiple URLs are allowed, separated by spaces. If download using one URL fails, the next one will be tried.

The URL can contain the variables $releasever and $basearch, which refer to the current release of the distribution (for example 4.0), and the architecture (for example x86_64 or aarch64).

enabled

Type: boolean

Default: false

Whether the repo is enabled. This can be overridden with the --disablerepo, --enablerepo, --repoid options on the command line.

gpgcheck

Type: boolean

Default: true

Whether to check packages for their gpg signature. If enabled, gpgkey needs to be set.

gpgkey

Type: list

Default: none

A list of URLs to the gpg keys. These will be downloaded if they are not on the system already. For URLs, allowed protocols are http:, https:, ftp:, ftps: and file:.

metalink

Type: string

Default: none

The URL of a metalink for the repository.

metadata_expire

Type: integer

Default: 172800 (2 days)

The maximum age for the downloaded metadata in seconds. If older, metadata will be refreshed on the next action that requires them.

minrate

Type: integer

Default: 0

name

Type: string

Default: none

A user friendly name for the repository.

password

Type: string

Default: none

The password for the repo, if required.

priority

Type: integer

Default: 50

The priority for the repository. Repositories will be ordered using this number, and those with a lower number will be preferred.

retries

Type: integer

Default: 10

How many times tdnf will retry a download on failure.

skip_if_unavailable

Type: boolean

Default: false

If the repository is not reachable and this is set tdnf will skip it.

skip_md_filelists, skip_md_other, skip_md_updateinfo

Type: boolean

Default: false

Skip downloading metadata parts. This will affect download and processing times when the cache is refreshed, especially for repositories with lots of packages. However, there are some drawbacks:

  • skip_md_filelists=1 will disable downloading file data, that is complete lists of files in all packages. This will affect repoquery queries for files.
  • skip_md_other=1 will disable download of misc data, mainly changelog data of packages. This will affect repoquery queries for changelogs.
  • skip_md_updateinfo=1 will disable downloading update info data, affecting the output of the updateinfo command.

sslcacert

Type: string

Default: none

sslclientcert

Type: string

Default: none

sslclientkey

Type: string

Default: none

sslverify

Type: boolean

Default: true

Whether to perform SSL verification.

throttle

Type: integer

Default: 0

timeout

Type: integer

Default: 0

Timeout for downloads. The default is 0 which means to never time out, see https://curl.se/libcurl/c/CURLOPT_TIMEOUT.html . However, the underlying systems calls may have their own timeouts and return with an error.

username

Type: string

The username for the repo, if required.