---
name: "dnf5.conf"
section: "5"
platform: "linux"
package: "dnf5"
version: "5.4.6.0-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/dnf5.conf"
---

# dnf5.conf(5)

DNF5 Configuration Reference

## NAME

dnf5.conf - DNF5 Configuration Reference

## DESCRIPTION

*DNF5* by default uses the global configuration file at /etc/dnf/dnf.conf.

The configuration file has INI format consisting of section declaration and name=value options below each on separate line. There are two types of sections in the configuration files: main and repository.  Main  section  defines all global configuration options and should be only one.

The repository  sections  define  the configuration for each (remote or local) repository. The section name of the repository in brackets serve as repo ID reference and should be unique  across  configuration  files.  The  allowed characters  of  repo  ID  string  are  lower and upper case alphabetic letters, digits, -, \_, .  and :. The minimal repository configuration file should aside from repo ID consists of baseurl, metalink or mirrorlist option  definition.

## \[MAIN\] OPTIONS

- **allow\_downgrade**

  boolean

  If enabled, DNF5 allows downgrading packages while resolving dependencies.

  Default: **True**.

- **allow\_vendor\_change**

  boolean

  If disabled, DNF5 will stick to the original vendor during RPM upgrades or downgrades. This preference, however, can be fine-tuned using Vendor change policies \<#dnf5-vendor-change-policy-label\>.

  Default: **True**.

  **Warning:**

  This option is currently not supported for *downgrade* and *distro-sync* commands

- **assumeno**

  boolean

  If enabled DNF5 will assume **No** where it would normally prompt for confirmation from user input

  Default: **False**.

- **assumeyes**

  boolean

  If enabled DNF5 will assume **Yes** where it would normally prompt for confirmation from user input (see also defaultyes).

  Default: **False**.

- **best**

  boolean

  If **True**, instructs the solver to either use a package with the highest available version or fail. If **False**, do not fail if the latest version cannot be installed and go with the lower version.

  Default: **True**.

  **Note:**

  This option in particular can be overridden by a distribution-specific configuration. For more details see drop-in configuration directories.

- **cachedir**

  string

  Path to a directory used by various DNF5 subsystems for storing cache data including repositories metadata and downloaded packages. Has a reasonable root-writable default depending on the distribution. DNF5 needs to be able to create files and directories at this location.

  Regular user default: **~/.cache/libdnf5**.

  For superuser the value is overwritten by system\_cachedir option.

- **cacheonly**

  string

  Can be **all**, **metadata**, **none**.

  If set to **all** DNF5 will run entirely from system cache, will not update the cache and will use the system cache even if it is expired.

  If set to **metadata** DNF5 will cache metadata only.

  Default: **none**.

  **Note:**

  API Notes: Must be set before repository objects are created. Plugins must set this in the pre\_config hook. Later changes are ignored.

- **check\_config\_file\_age**

  boolean

  If enabled DNF5 should automatically expire metadata of repos, which are older than their corresponding configuration file (usually the dnf.conf file and the foo.repo file).

  Default: **True**.

  **Note:**

  Expire of metadata is also affected by metadata age. See also

  metadata\_expire.

- **clean\_requirements\_on\_remove**

  boolean

  If enabled, DNF5 will remove dependencies that are no longer used during **dnf remove**. A package only qualifies for removal via **clean\_requirements\_on\_remove** if it was installed through DNF5 but not on explicit user request, i.e. it was pulled in as a dependency.

  installonlypkgs are never automatically removed.

  Default: **True**.

- **debugdir**

  string

  Location where libsolv debug files will be created when enabled by debug\_solver.

  Default *./debugdata*.

- **debug\_solver**

  boolean

  If enabled, libsolv debug files will be created when solving the transaction. The debug files are created in the debugdir directory.

  Default: **False**.

- **defaultyes**

  boolean

  If enabled, the default answer to user confirmation prompts will be **Yes**. Not to be confused with assumeyes which will not prompt at all.

  Default: **False**.

- **destdir**

  string

  Redirect downloaded packages to provided directory.

  Default: \<package repository cachedir\>/packages

- **exclude\_from\_weak**

  list

  Prevent installing packages as weak dependencies (recommends or supplements). The packages can be specified by a name or a glob and separated by a comma.

  Defaults to \[\].

- **exclude\_from\_weak\_autodetect**

  boolean

  If enabled, DNF5 will autodetect unmet weak dependencies (recommends or supplements) of packages installed on the system. Providers of these weak dependencies will not be installed by dnf as weak dependencies any more (they will still be installed if pulled in as a regular dependency).

  Defaults to true.

- **excludeenvs**

  list

  Exclude environments, specified by an id or a glob and separated by a comma, from all operations.

  Can be disabled using **disable\_excludes** config option.

  Default: **\[\]**.

- **excludegroups**

  list

  Exclude groups, specified by an id or a glob and separated by a comma, from all operations.

  Can be disabled using **disable\_excludes** config option.

  Default: **\[\]**.

**gpgcheck**

Due to compatibility **gpgcheck** option is supported as well but **pkg\_gpgcheck** is preferred. The meaning of **gpgcheck** is controlled by the gpgcheck\_policy option.

Default: **pkg\_gpgcheck** value.

- **gpgcheck\_policy**

  **legacy**, **full**, or **all**

  Controls how the **gpgcheck** option expands when explicitly set in a configuration section.

  - **legacy**

    **gpgcheck=1** sets only **pkg\_gpgcheck=1**. This preserves the original DNF behavior.

  - **full**

    **gpgcheck=1** sets both **pkg\_gpgcheck=1** and **repo\_gpgcheck=1**.

  - **all**

    **gpgcheck=1** sets **pkg\_gpgcheck=1**, **repo\_gpgcheck=1**, and **localpkg\_gpgcheck=1**.

  Explicitly setting **pkg\_gpgcheck**, **repo\_gpgcheck**, or **localpkg\_gpgcheck** in the same configuration section overrides the policy for that specific option.

  The policy is a global setting defined in **\[main\]** and affects all repository sections that use **gpgcheck**.

  Default: **legacy**.

- **group\_package\_types**

  list

  List of the following: **optional**, **default**, **mandatory** or **conditional**.

  Tells DNF5 which type of packages in groups will be installed when 'group install \<group-spec\>' or 'install @\<group-spec\>' is called.

  Default: **default, mandatory, conditional**.

- **ignorearch**

  boolean

  If enabled, RPM will allow attempts to install packages incompatible with the CPU's architecture.

  Default: **False**.

- **installonlypkgs**

  list

  List of provide names of packages that should only ever be installed, never upgraded. Kernels in particular fall into this category. These packages are never removed by **dnf autoremove** even if they were installed as dependencies (see clean\_requirements\_on\_remove for auto removal details). This option append the list values to the default installonlypkgs list used by DNF5. The number of kept package versions is regulated by installonly\_limit.

- **installonly\_limit**

  integer

  Number of installonly packages allowed to be installed concurrently.

  **1** is explicitly not allowed since it complicates kernel upgrades due to protection of the running kernel from removal.

  Minimum is **2**.

  **0** means unlimited number of installonly packages.

  Default: **3**.

- **installroot**

  string

  The root of the filesystem for all packaging operations. It requires an absolute path. See also --installroot commandline option.

  Default: **/**.

- **install\_weak\_deps**

  boolean

  If enabled, when a new package is about to be installed, all packages linked by weak dependency relation (Recommends or Supplements flags) with this package will be pulled into the transaction.

  Default: **True**.

- **keepcache**

  boolean

  If enabled, keeps downloaded packages in the cache. If disabled cache will persist until the next successful transaction even if no packages have been installed.

  Default: **False**.

- **logdir**

  string

  Directory where the log files will be stored.

  Regular user default: **~/.local/state**.

  Superuser default: **/var/log**.

- **log\_rotate**

  integer

  Log files are rotated **log\_rotate** times before being removed. If **log\_rotate** is **0**, the rotation is not performed.

  Default: **4**.

- **log\_size**

  storage size

  Log  files are rotated when they grow bigger than **log\_size** bytes. If **log\_size** is **0**, the rotation is not performed.

  The size applies for individual log files, not the sum of all log files. See also log\_rotate.

  Default: **1M**.

- **module\_platform\_id**

  string

  Set this to **$name:$stream** to override **PLATFORM\_ID** detected from **/etc/os-release**. It is necessary to perform a system upgrade and switch to a new platform.

  Default: empty.

- **module\_stream\_switch**

  boolean

  If enabled, allows switching enabled streams of a module.

  Default: **False**.

- **multilib\_policy**

  string

  Controls how multilib packages are treated during install operations.

  Can either be **best** for the depsolver to prefer packages which best match the system's architecture, or **all** to install packages for all available architectures.

  Default: **best**.

- **obsoletes**

  boolean

  If enabled, DNF5 uses obsoletes processing logic, which means it checks whether any dependencies of given package are no longer required and removes them.

  Useful when doing distribution level upgrades.

  It has effect during install/upgrade processes.

  Command-line option: --obsoletes

  Default: **True**.

- **optional\_metadata\_types**

  list

  List of the following: **comps**, **filelists**, **other**, **presto**, **updateinfo**, **all**

  Specifies the types of metadata to load in addition to the essential **primary** and **modules** metadata, which are always loaded. Note that individual DNF commands may extend this list at runtime.

  Note: The list includes only metadata types recognized by DNF. However, a repository's metadata may include various other types (e.g., AppStream or metadata stored as databases instead of XML files). The special value **all** represents all metadata types present in the repository, including those unknown to DNF.

  Default: **comps,updateinfo**

- **persistdir**

  string

  Directory where DNF5 stores its persistent data between runs.

  Default: **/var/lib/dnf**.

- **persistence**

  string

  Whether changes should persist across system reboots. Passing **--transient** (see transient option \<#transient-option-label\>) will override this setting to **transient**. Valid values are:

  - •

    **auto**: Changes will persist across reboots, unless the target is a running bootc system and the system is already in an unlocked state (i.e. **/usr** is writable).

  - •

    **transient**: Changes will be lost on the next reboot. Only applicable on bootc systems. Beware that changes to **/etc** and **/var** will persist, depending on the configuration of your bootc system. See also \<https://bootc.dev/bootc//man/bootc-usr-overlay.8.html\>.

  - •

    **persist**: Changes will persist across reboots.

  Default: **auto**.

- **pluginconfpath**

  list

  List of directories that are searched for libdnf5 plugin configurations to load.

  All configuration files found in these directories, that are named same as a plugin, are parsed.

  Default: **/etc/dnf/libdnf5-plugins**.

- **pluginpath**

  list

  List of directories that are searched for libdnf5 plugins to load. Plugins found in *any of the directories* in this configuration option are used.

  Default: **/usr/lib64/libdnf5/plugins/**

- **plugins**

  boolean

  If enabled, libdnf5 plugins are enabled.

  Default: **True**.

- **protected\_packages**

  list

  This append list option contains names of packages that DNF5 should never completely remove.

  They are protected via Obsoletes as well as user/plugin removals.

  An entry prefixed with **glob:**, such as **glob:/path/to/dir/\*.conf**, expands to all matching files and reads one package per line from each.

  Default: **dnf5,glob:/etc/dnf/protected.d/\*.conf**.

  **Note:**

  DNF5 will protect also the package corresponding to the running version of the kernel. See also protect\_running\_kernel option.

- **protect\_running\_kernel**

  boolean

  Controls whether the package corresponding to the running version of kernel is protected from removal.

  Default: **True**.

  **Note:**

  YUM compatibility option

- **recent**

  integer

  Sets the time period in days used for the **--recent** option in the repoquery \<#repoquery-command-ref-label\>, info \<#info-command-ref-label\> and list \<#list-command-ref-label\> commands.

  Default: 7

- **reposdir**

  list

  Repository configuration files locations.

  The behavior of **reposdir** could differ when it is used along with --installroot option.

  Default: \[**/etc/yum.repos.d**, **/etc/distro.repos.d**, **/usr/share/dnf5/repos.d**\]

- **skip\_broken**

  boolean

  If enabled, DNF5 will skip uninstallable packages instead of failing while resolving dependencies.

  Default: **False**.

- **skip\_system\_repo\_lock**

  boolean

  Skip acquiring a lock on the system repository (equivalent to the RPM database). The lock is used to prevent processes from reading the system repository while another process is running a transaction. Unprivileged users are allowed to acquire a read lock on the system repository, so **skip\_system\_repo\_lock=true** may be used to ignore their lock.

- **skip\_unavailable**

  boolean

  If enabled, DNF5 will skip unavailable packages instead of failing while preparing rpm transactions.

  Default: **False**.

**system\_cachedir**

string

For superuser overwrites the cachedir option value.

Allows one to differentiate user and superuser cachedir.

Default: **/var/cache/libdnf5**.

- **system\_state\_dir**

  string

  System state files location. See **[dnf5-system-state(7)](/dnf5-system-state/7.md)**, system state \<#systemstate-misc-ref-label\> for details.

  Default: **/usr/lib/sysimage/libdnf5**.

**transaction\_history\_dir**

string

History database location.

By default it has the same value as system\_state\_dir.

- **tsflags**

  list

  List of strings adding extra flags for the RPM transaction.

  | | |
  | --- | --- |
  | tsflag value | RPM Transaction Flag |
  | **noscripts** | **RPMTRANS\_FLAG\_NOSCRIPTS** |
  | **test** | **RPMTRANS\_FLAG\_TEST** |
  | **notriggers** | **RPMTRANS\_FLAG\_NOTRIGGERS** |
  | **nodocs** | **RPMTRANS\_FLAG\_NODOCS** |
  | **justdb** | **RPMTRANS\_FLAG\_JUSTDB** |
  | **nocontexts** | **RPMTRANS\_FLAG\_NOCONTEXTS** |
  | **nocaps** | **RPMTRANS\_FLAG\_NOCAPS** |
  | **nocrypto** | **RPMTRANS\_FLAG\_NOFILEDIGEST** |
  | **deploops** | **RPMTRANS\_FLAG\_DEPLOOPS** |
  | **noplugins** | **RPMTRANS\_FLAG\_NOPLUGINS** |

  The **nocrypto** option will also set the **\_RPMVSF\_NOSIGNATURES** and **\_RPMVSF\_NODIGESTS** VS flags.

  The **test** option provides a transaction check without performing the transaction. It includes downloading of packages, OpenPGP keys check (including permanent import of additional keys if necessary), and rpm check to prevent file conflicts.

  The **noplugins** option disables use of rpm plugins.

  Default: empty.

**use\_host\_config**

Use configuration files and variable definitions from the host system rather than the installroot. See \<#installroot-misc-ref-label\> **[dnf5-installroot(7)](/dnf5-installroot/7.md)** for more info.

Default: **False**.

- **usr\_drift\_protected\_paths**

  list

  List of paths that are likely to cause problems when their contents drift with respect to **/usr**, e.g. **/etc/pam.d/\***. If a transient transaction would modify these paths, DNF5 aborts the operation and prints an error.

  When using **persistence=transient** on bootc systems, a transient overlay is created on **/usr**, and any changes DNF5 makes to **/usr** will be discarded on reboot. However, other paths such as **/etc** and **/var** are (often) not backed by a transient overlay, so changes to them will persist across reboots. Usually, this "filesystem drift" is fine, but it can cause problems in certain situations. For example, a configuration file in **/etc** that's shared by multiple packages might reference a **.so** file under **/usr/lib64** that no longer exists.

  If any paths are protected by this option, DNF5 will download filelist metadata from repositories before resolving transient transactions.

  An entry prefixed with **glob:**, such as **glob:/path/to/dir/\*.conf**, expands to all matching files and reads one path per line from each. Both the glob pattern in the option list entry and the individual paths listed within the files (e.g. **/etc/pam.d/\***) may contain globs.

  Default: **glob:/etc/dnf/usr-drift-protected-paths.d/\*.conf**.

- **varsdir**

  list

  List of directories where variables definition files are looked for.

  See variable files in Configuration reference.

  Default: **/etc/dnf/vars**.

- **zchunk**

  boolean

  If enabled, repository metadata are compressed using the zchunk format (if available).

  Default: **True**.

## \[MAIN\] OPTIONS - COLORS

- **color\_list\_available\_upgrade**

  color

  Color of available packages that are newer than installed packages. The option is used during list operations.

  Default: **bold,blue**.

- **color\_list\_available\_downgrade**

  color

  Color of available packages that are older than installed packages. The option is used during list operations.

  Default: **dim,magenta**.

- **color\_list\_available\_reinstall**

  color

  Color of available packages that are identical to installed versions and are available for reinstalls. The option is used during list operations.

  Default: **bold,green**.

- **color\_list\_available\_install**

  color

  Color of packages that are available for installation and none of their versions in installed. The option is used during list operations.

  Default: **bold,cyan**.

- **color\_update\_installed**

  color

  Color of removed packages. This option is used during displaying transactions.

  Default: **dim,red**.

- **color\_update\_local**

  color

  Color of local packages that are installed from the @commandline repository. This option is used during displaying transactions.

  Default: **dim,green**.

- **color\_update\_remote**

  color

  Color of packages that are installed/upgraded/downgraded from remote repositories. This option is used during displaying transactions.

  Default: **bold,green**.

- **color\_search\_match**

  color

  Color of patterns matched in search output.

  Default: **bold,magenta**.

## REPO OPTIONS

- **baseurl**

  list

  List of URLs for the repository.

  Default \[\].

  URLs are tried in the listed order (equivalent to yum’s “failovermethod=priority” behaviour).

- **cost**

  integer

  The relative cost of accessing this repository, defaulting to 1000. This value is compared when the priorities of two repositories are the same. The repository with the lowest cost is picked. It is useful to make the library prefer on-disk repositories to remote ones.

- **enabled**

  boolean

  Include this repository as a package source.

  Default: **True**.

- **gpgkey**

  list

  URLs of a OpenPGP key files that can be used for signing metadata and packages of this repository. If a file can not be verified using the already imported keys, import of keys from this option is attempted and the keys are then used for verification.

  Default: **\[\]**

- **metalink**

  string

  URL of a metalink for the repository.

  Default: **None**.

- **mirrorlist**

  string

  URL of a mirrorlist for the repository.

  Default: **None**.

- **name**

  string

  A human-readable name of the repository. Defaults to the ID of the repository.

- **priority**

  integer

  The priority value of this repository. If there is more than one candidate package for a particular operation, the one from a repo with the lowest priority value is picked, possibly despite being less convenient otherwise (e.g. by being a lower version).

  Default: 99

- **type**

  string

  Type of repository metadata. Supported values are: **rpm-md**. Aliases for **rpm-md**: **rpm**, **repomd**, **rpmmd**, **yum**, **YUM**.

  Default: empty.

## SOURCE AND DEBUGINFO REPOSITORY NAMES

For a given repository with an identifier in the form "\<ID\>-rpms", its corresponding source repository is expected to have an identifier in the form "\<ID\>-source-rpms" and debuginfo repository an identifier in the form "\<ID\>-debug-rpms". Otherwise (if the repository identifier doesn't have the "-rpms" suffix), the source repository is expected to have an identifier in the form "\<ID\>-source" and debuginfo repository an identifier in the form "\<ID\>-debuginfo".

For example, for repository "fedora", the source repository is "fedora-source" and debuginfo repository is "fedora-debuginfo". For repository "fedora-rpms", the source repository is "fedora-source-rpms" and debuginfo repository is "fedora-debug-rpms".

## REPO VARIABLES

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 DNF5 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
```

## OPTIONS FOR BOTH \[MAIN\] AND REPO

Some options can be applied in either the main section, per repository, or in a combination. The value provided in the main section is used for all repositories as the default value, which repositories can then override in their configuration.

- **bandwidth**

  storage size

  Total bandwidth available for downloading, in bytes per second. Used for both metadata and package downloads. This value is only used when the throttle option is set as a percentage. When **throttle** is set as an absolute value, **bandwidth** is ignored.

  Default: **0** (no limit).

- **build\_cache**

  boolean

  If enabled, DNF5 will save libsolv cache generated from downloaded metadata to cachedir. These solv files are loaded during subsequent runs which significantly speeds up DNF5.

  Default: **True**.

- **countme**

  boolean

  When enabled, one (and only one) HTTP GET request for the metalink file will be selected at random every week to carry a special URL flag.

  This flag allows the repository provider to estimate the number of systems consuming the repository, by counting such requests over a week's time. This method is more accurate than just counting unique IP addresses (which is subject to both overcounting and undercounting due to short DHCP leases and NAT, respectively).

  This is *not* an out-of-band HTTP request made for this purpose alone. Only requests initiated by DNF during normal operation, such as to check for metadata updates, can get this flag.

  The flag is a simple "countme=N" parameter appended to the metalink URL where N is an integer representing the age "bucket" this system belongs to. Four buckets are defined, based on how many full weeks have passed since the installation of a system:

  | | |
  | --- | --- |
  | bucket | system age |
  | 1 | first week |
  | 2 | first month (2 - 4 weeks) |
  | 3 | first 6 months (5 - 24 weeks) |
  | 4 | more than 6 months (\> 24 weeks) |

  This number is meant to help distinguish short-lived (throwaway) machines from long-term installs and get a better picture of how systems are used over time.

  To determine a system's installation time ("epoch"), the **[machine-id(5)](/machine-id/5.md)** file's modification time is used as the single source of truth. This file is semantically tied to the system's lifetime as it's typically populated at installation time or during the first boot by an installer tool or init system (such as **[systemd(1)](/systemd/1.md)**), respectively, and remains unchanged.

  If the file is empty or missing (such as in containers), the time of the very first request made using the expanded metalink URL (i.e. with any repository variables such as **$releasever** substituted) that carried the flag is declared as the epoch.

  If no metalink URL is defined for this repository but a mirrorlist URL is, the latter is used for this purpose instead.

  Default: **False**.

- **disable\_excludes**

  list

  Used to disable package, group and environment filtering. It can include a list of repository IDs (globs allowed) for which repository-specific package excludes are ignored. If it contains the special value **main**, excludes from the main configuration files are bypassed. If it contains the special value **\***, no excludes filtering is applied at all.

- **enablegroups**

  boolean

  If enabled, DNF5 will allow the use of package groups.

  Default: **True**.

- **excludepkgs**

  list

  Exclude packages of this repository, specified by a name or a glob and separated by a comma, from all operations.

  Can be disabled using **disable\_excludes** config option.

  Default: **\[\]**.

- **fastestmirror**

  boolean

  If enabled, TCP socket latency is used to find the closest available mirror. A mirror is then selected at random with less than twice the lowest latency for load balancing purposes. This overrides the order provided by the mirrorlist/metalink file itself, and does not take into consideration mirrorlist parameters such as mirror bandwidth nor preferred mirrors for client IP addresses.

  Default: **False**.

- **pkg\_gpgcheck**

  boolean

  Whether to perform OpenPGP signature check on packages found in this repository.

  The default is False.

  Doesn't apply for packages passed directly as arguments, as they are not in any repository, see localpkg\_gpgcheck.

- **includepkgs**

  list

  Include packages of this repository, specified by a name or a glob and separated by a comma, in all operations.

  Inverse of excludepkgs, DNF5 will exclude any package in the repository that doesn't match this list.

  This works in conjunction with excludepkgs and doesn't override it, so if you 'excludepkgs=\*.i386' and 'includepkgs=python\*' then only packages starting with python that do not have an i386 arch will be seen by DNF5 in this repo.

  Can be disabled using **disable\_excludes** config option.

  Default: **\[\]**.

- **ip\_resolve**

  ip address

  Determines how DNF5 resolves host names. Set this to **4**, **IPv4**, **6**, **IPv6** to resolve to IPv4 or IPv6 addresses only.

  Default: **whatever**.

- **localpkg\_gpgcheck**

  boolean

  If enabled, DNF5 will perform a OpenPGP signature check on local packages (packages in a file, not in a repository).

  Default: **False**.

- **max\_parallel\_downloads**

  integer

  Maximum number of simultaneous downloads. Max is **20**.

  Default: **3**.

- **max\_downloads\_per\_mirror**

  integer

  Maximum number of simultaneous downloads per mirror. Max is **20**.

  Default: **3**.

- **metadata\_expire**

  time in seconds

  The period after which the remote repository is checked for metadata update and in the positive case the local metadata cache is updated. It can be **-1** or **never** to make the repo never considered expired.

  Expire of metadata can be also triggered by change of timestamp of configuration files (**dnf.conf**, **\<repo\>.repo**).

  See also check\_config\_file\_age.

  Default: **60 \* 60 \* 48**, 48 hours.

- **minrate**

  storage size

  Sets the low speed threshold in bytes per second. If the server is sending data at the same or slower speed than this value for at least timeout option seconds, DNF5 aborts the connection.

  Default: **1000**.

- **password**

  string

  The password used to connect to a repository with basic HTTP authentication.

  Default: empty.

- **proxy**

  string

  URL of a proxy server to connect through.

  Set to an empty string in the repository configuration to disable proxy setting inherited from the main section. The expected format of this option is **\<scheme\>://\<ip-or-hostname\>\[:port\]**. (For backward compatibility, '\_none\_' can be used instead of the empty string.)

  Default: empty.

  **Note:**

  The curl environment variables (such as **http\_proxy**) are effective if this option is unset (or '\_none\_' is set in the repository configuration). See the **curl** man page for details.

- **proxy\_username**

  string

  The username to use for connecting to the proxy server.

  Default: empty.

- **proxy\_password**

  string

  The password to use for connecting to the proxy server.

  Default: empty.

- **proxy\_auth\_method**

  string

  The authentication method used by the proxy server. Valid values are

  | | |
  | --- | --- |
  | method | meaning |
  | **basic** | HTTP Basic authentication |
  | **digest** | HTTP Digest authentication |
  | **negotiate** | HTTP Negotiate (SPNEGO) authentication |
  | **ntlm** | HTTP NTLM authentication |
  | **digest\_ie** | HTTP Digest authentication with an IE flavor |
  | **ntlm\_wb** | NTLM delegating to winbind helper |
  | **none** | None auth method |
  | **any** | All suitable methods |

  Default: **any**.

- **proxy\_sslcacert**

  string

  Path to the file containing the certificate authorities to verify proxy SSL certificates.

  Default: empty, uses system default.

- **proxy\_sslclientcert**

  string

  Path to the SSL client certificate used to connect to proxy server.

  Default: empty.

- **proxy\_sslclientkey**

  string

  Path to the SSL client key used to connect to proxy server.

  Default: empty.

- **proxy\_sslverify**

  boolean

  If enabled, proxy SSL certificates are verified. If the client can not be authenticated, connecting fails and the repository is not used any further. If **False**, SSL connections can be used, but certificates are not verified.

  Default: **True**.

- **repo\_gpgcheck**

  boolean

  If enabled, DNF5 will perform OpenPGP signature check on this repository's metadata.

  **Note:**

  OpenPGP keys for this check are stored separately from OpenPGP keys used in package signature verification. Furthermore, they are also stored separately for each repository.

  This means that DNF5 may ask to import the same key multiple times. For example, when a key was already imported for package signature verification and this option is turned on, it may be needed to import it again for the repository.

  Default: **False**.

- **skip\_if\_unavailable**

  boolean

  If enabled, DNF5 will continue running and disable the repository that couldn't be synchronized for any reason. This option doesn't affect skipping of unavailable packages after dependency resolution. To check inaccessibility of repository use it in combination with refresh command line option \<#refresh-option-label\>.

  Default: **False**.

  **Note:**

  This option in particular can be overridden by a distribution-specific configuration. For more details see drop-in configuration directories.

- **sslcacert**

  string

  Path to the file containing the certificate authorities to verify SSL certificates.

  Default: empty, uses system default.

- **sslclientcert**

  string

  Path to the SSL client certificate used to connect to remote sites.

  Default: empty.

- **sslclientkey**

  string

  Path to the SSL client key used to connect to remote sites.

  Default: empty.

- **sslverify**

  boolean

  If enabled, remote SSL certificates are verified. If the client can not be authenticated, connecting fails and the repository is not used any further. If disabled, SSL connections can be used, but certificates are not verified.

  Default: **True**.

- **throttle**

  storage size

  Limits the downloading speed, in bytes per second. Applied to both metadata and package downloads. It can be an absolute value (e.g. **5M** for 5 MiB/s) or a percentage (e.g. **60%**). When given as a percentage, the actual speed limit is calculated relative to the bandwidth option value. **0** means no throttling. The resulting speed limit must not be lower than minrate.

  Default: **0**.

- **timeout**

  time in seconds

  Number of seconds to wait for a connection before timing out. Used in combination with minrate option option.

  Default: **30**.

- **username**

  string

  The username to use for connecting to repo with basic HTTP authentication.

  Default: empty.

- **user\_agent**

  string

  The User-Agent string to include in HTTP requests sent by DNF5.

  Default:

  ```
  libdnf (NAME VERSION_ID; VARIANT_ID; OS.BASEARCH)
  ```

  **Note:**

  **NAME**, **VERSION\_ID** and **VARIANT\_ID** are OS identifiers read from the **[os-release(5)](/os-release/5.md)** file, and **OS** and **BASEARCH** are the canonical OS name and base architecture, respectively. Example:

  ```
  libdnf (Fedora 39; server; Linux.x86_64)
  ```

## TYPES OF OPTIONS

- **boolean**

  Data type with only two possible values.

  One of following options can be used: **1**, **0**, **True**, **False**, **yes**, **no**.

- **color**

  String describing color and modifiers separated with a comma, for example **red,bold**.

  - •

    Colors: **black**, **blue**, **cyan**, **green**, **magenta**, **red**, **white**, **yellow**.

  - •

    Modifiers: **bold**, **blink**, **dim**, **normal**, **reverse**, **underline**.

- **integer**

  Whole number that can be written without a fractional component.

- **ip address type**

  String describing ip address types.

  One of the following options can be used: **4**, **IPv4**, **6**, **IPv6**.

- **list**

  String representing one or more strings separated by space or comma characters. The backslash **'\\'** can be used to escape any character, allowing it to be included literally in the individual strings.

  Example: **'item1,item2\\,with\\,commas,item3\\ with\\ spaces item4'**

- **storage size**

  String representing storage sizes in bytes formed by an integer and a unit.

  Valid units are **k**, **M**, **G**.

- **string**

  It is a sequence of symbols or digits without any whitespace character.

- **time in seconds**

  String representing time units in seconds. Can be set to **-1** or **never**.

## DROP-IN CONFIGURATION DIRECTORIES

*DNF5* loads configuration options that are defined in the main configuration file, user configuration files and distribution configuration files.

The configuration files are processed following this order:

- 1\.

  Configuration files are alphabetically sorted in a list of names from the distribution configuration directory and the user configuration directory. If a file with the same name is present in both directories, only the file from the user configuration directory is added to the list. The distribution file is then masked by the user file.

- 2\.

  Options are retrieved in order from the list The configuration from the next file overrides the previous one. The last option wins.

### Example of configuration files

User configuration files:

- •

  /etc/dnf/dnf.conf

- •

  /etc/dnf/libdnf5.conf.d/20-user-settings.conf

- •

  /etc/dnf/libdnf5.conf.d/60-something.conf

- •

  /etc/dnf/libdnf5.conf.d/80-user-settings.conf

Distribution configuration files:

- •

  /usr/share/dnf5/libdnf.conf.d/50-something.conf

- •

  /usr/share/dnf5/libdnf.conf.d/60-something.conf

- •

  /usr/share/dnf5/libdnf.conf.d/90-something.conf

Resulting file loading order by default (/usr/share/dnf5/libdnf.conf.d/60-something.conf is skipped, masked by the user file /etc/dnf/libdnf5.conf.d/60-something.conf):

- 1\.

  /etc/dnf/libdnf5.conf.d/20-user-settings.conf

- 2\.

  /usr/share/dnf5/libdnf.conf.d/50-something.conf

- 3\.

  /etc/dnf/libdnf5.conf.d/60-something.conf

- 4\.

  /etc/dnf/libdnf5.conf.d/80-user-settings.conf

- 5\.

  /usr/share/dnf5/libdnf.conf.d/90-something.conf

- 6\.

  /etc/dnf/dnf.conf

### Files and directories

- **User Configuration Directory**

  /etc/dnf/libdnf5.conf.d/

- **User Configuration Files**

  /etc/dnf/libdnf5.conf.d/20-user-settings.conf

- **Distribution Configuration Directory**

  /usr/share/dnf5/libdnf.conf.d/

- **Distribution Configuration Files**

  /usr/share/dnf5/libdnf.conf.d/50-something.conf

## DROP-IN REPO DIRECTORIES

After the repository configurations are loaded other repo configurations can be overloaded from the directories user repos override directory and distribution repos override directory.

The format of the files inside the directories is the same as the format of the repository configuration files. The options in the overridden files can modify existing repos but cannot create new repositories.

Override files support globs in the repository ID in order to support bulk modifications of repository parameters.

The repository overrides are processed following this order:

- 1\.

  Files from **/usr/share/dnf5/repos.override.d/** and **/etc/dnf/repos.override.d/** are loaded in an alphabetically sorted list. In case files have the same name, the file from **/etc/dnf/repos.override.d/** is used. This implies the list has only unique filenames. This also implies that the repository configuration files can be simply masked by creating a file with the same name in the **/etc** override directory.

- 2\.

  The options from the files are applied in the order they are loaded. The last option wins.

**Note:**

See also the documentation for Config-manager Command \<#config-manager-plugin-ref-label\> to see where the overrides are used.

### Example configuration

```
# Enable `skip_if_unavailable` for all repositories
[*]
skip_if_unavailable = true
# And then disable `skip_if_unavailable` for repositories with id prefix "fedora"
[fedora*]
skip_if_unavailable = false
```

### Example of configuration files

This example shows the order in which override files are processed.

Files with user repos overrides:

- •

  /etc/dnf/repos.override.d/20-user-overrides.repo

- •

  /etc/dnf/repos.override.d/60-something2.repo

- •

  /etc/dnf/repos.override.d/80-user-overrides.repo

- •

  /etc/dnf/repos.override.d/99-config-manager.repo

Files with distribution repos overrides:

- •

  /usr/share/dnf5/repos.override.d/50-something2.repo

- •

  /usr/share/dnf5/repos.override.d/60-something2.repo

- •

  /usr/share/dnf5/repos.override.d/90-something2.repo

Resulting file processing order:

- 1\.

  /etc/dnf/repos.override.d/20-user-overrides.repo

- 2\.

  /usr/share/dnf5/repos.override.d/50-something2.repo

- 3\.

  /etc/dnf/repos.override.d/60-something2.repo

- 4\.

  /etc/dnf/repos.override.d/80-user-overrides.repo

- 5\.

  /usr/share/dnf5/repos.override.d/90-something2.repo

- 6\.

  /etc/dnf/repos.override.d/99-config-manager.repo

### Files and directories

- **User Repos Override Directory**

  /etc/dnf/repos.override.d/

- **User Repos Override Files**

  /etc/dnf/repos.override.d/20-user-overrides.repo

- **Distribution Repos Override Directory**

  /usr/share/dnf5/repos.override.d/

- **Distribution Repos Override Files**

  /usr/share/dnf5/repos.override.d/50-something2.repo

## FILES

- **Main Configuration File**

  /etc/dnf/dnf.conf

- **Cache Files**

  /var/cache/libdnf5

- **Repository Files**

  /etc/yum.repos.d/

- **Variables**

  Any property named file in **/etc/dnf/vars** is turned into a variable named after the filename (or overrides any of the above variables but those set from commandline). Filenames may contain only alphanumeric characters and underscores and be in lowercase. Variables are also read from **/etc/yum/vars** for YUM compatibility reasons.

## DIRECTORIES

### Repository Directories

Directories are listed in the order in which they are processed.

**Note:**

Unlike overrides that modify an existing repository configuration, the configuration in these directories defines new repositories. It is not possible to define repositories with the same ID. If multiple repositories with the same ID are defined only the first configuration will be loaded. Loading the next one will log an error.

- **YUM Repositories Directory**

  /etc/yum.repos.d/

- **Distribution Repositories Directory in /etc**

  /etc/distro.repos.d/

- **Distribution Repositories Directory in /usr**

  /usr/share/dnf5/repos.d/

### Variables Directories

- **Variables Directory**

  /etc/dnf/vars/

- **Distribution Variables Directory**

  /usr/share/dnf5/vars.d/

## SEE ALSO

- •

  **[dnf5(8)](/dnf5/8.md)**, DNF5 Command Reference \<#command-ref-label\>

- •

  **[dnf5.conf-vendorpolicy(5)](/dnf5.conf-vendorpolicy/5.md)**, DNF5 Vendor Change Policy File Reference \<#dnf5-vendor-change-policy-label\>

- •

  **[dnf5.conf-todo(5)](/dnf5.conf-todo/5.md)**, Options that are documented/implemented in DNF but not in DNF5 \<#dnf5-conf-todo-label\>

- •

  **[dnf5.conf-deprecated(5)](/dnf5.conf-deprecated/5.md)**, Config Options that are deprecated in DNF5 \<#dnf5-conf-deprecated-label\>

## Author

See AUTHORS.md in dnf5 source distribution.

## Copyright

Contributors to the dnf5 project.
