Right side of every repo option can be enriched by the following
variables:
$arch
Refers to the system's CPU architecture e.g, aarch64, i586,
i686 and x86_64.
$basearch
Refers to the base architecture of the system. For example,
i686 and i586 machines both have a base architecture of i386,
and AMD64 and Intel64 machines have a base architecture of
x86_64.
$releasever
Refers to the release version of operating system which DNF
derives from information available in RPMDB.
In addition to these hard coded variables, user-defined ones can
also be used. They can be defined either via variable files, or
by using special environmental variables. The names of these
variables must be prefixed with DNF_VAR_ and they can only
consist of alphanumeric characters and underscores:
$ DNF_VAR_MY_VARIABLE=value
To use such variable in your repository configuration remove the
prefix. E.g.:
[myrepo]
baseurl=https://example.site/pub/fedora/$MY_VARIABLE/releases/$releasever
Note that it is not possible to override the arch
and basearch
variables using either variable files or environmental variables.
Although users are encouraged to use named variables, the
numbered environmental variables DNF0
- DNF9
are still supported:
$ DNF1=value
[myrepo]
baseurl=https://example.site/pub/fedora/$DNF1/releases/$releasever