Scroll to navigation

DNF5-CONFIG-MANAGER(8) dnf5 DNF5-CONFIG-MANAGER(8)

NAME

dnf5-config-manager - Config-manager Command

SYNOPSIS

dnf5 config-manager <subcommand> [options] [arguments]

DESCRIPTION

Manages main configuration, repositories configuration, and variables.

SUBCOMMANDS

Adds a new repositories configuration file specified by URL or local path.

The file is copied without changes. The destination file name can be defined using the --save-filename option, otherwise it is taken from the source specification. If the .repo extension is missing from the destination filename, it will be added.

The destination directory path is the first path stored in the reposdir option (by default /etc/yum.repos.d). Overwriting/replacing an existing file can be enabled using the --overwrite option. Before the new repositories configuration file is finally saved, it is analyzed and tested for validity. Repository IDs are also tested. Repositories with the same ID must not be defined in other configuration files.

Adds a new repository defined using user options.

At least one of --set=baseurl=<URL>, --set=mirrorlist=<URL>, --set=metalink=<URL> must be set to a non-empty URL. The repository ID can be defined using the --id option, otherwise it is generated from the URL. The destination file name can be defined using the --save-filename option, otherwise it is set to the repository ID. If the .repo extension is missing from the destination filename, it will be added.

The destination directory path is the first path stored in the reposdir option (by default /etc/yum.repos.d). Overwriting/replacing an existing file can be enabled using the --overwrite option. Modifying an existing file can be enabled using the --add-or-replace option. Modification means that the new repository is added to the existing file or a repository with the same ID is replaced in the file. Before the new repository configuration is finally saved, the repository ID is tested. A repository with the same ID must not be defined in another configuration file.

Sets options in the main configuration file and in the repositories configuration override file.

The main configuration is read first from the files in the drop-in directories and then from the main configuration file (by default /etc/dnf/dnf.conf). So, options from main configuration file are read last and override the values of the same options defined in the drop-in directories.

The repositories configuration is read from the repository configuration files and then adjusted using repository configuration overrides. Repository configuration override files are read from the distribution repository override directory (/usr/share/dnf5/repos.override.d) and from the system repository override directory (/etc/dnf/repos.override.d). If a file with the same name is present in both override directories, only the file from the system override directory is used. Thus, the distribution override file can simply be masked by creating a file with the same name in the system override directory. All used override files are sorted alphabetically by their names and then applied in that order. The override from the next file overwrites the previous one---the last override wins.

The setopt command writes the repositories configuration overrides to a file named 99-config_manager.repo located in the system repository override directory. Repository settings are written only to this override file. The original repository configuration file is not changed. Reposiory ID may contain globs. Override files also support globs. But the setopt command resolves the repoid pattern, and overrides are set for each matching repository independently. This means repositories added later will not be affected by these overrides.

Removes options from the main configuration file and from the repositories configuration override file.

The unsetopt command removes options from the main configuration file (by default /etc/dnf/dnf.conf). However, the options may be still defined in configuration files in drop-in directories (for example, the default distribution configuration).

The unsetopt command removes repository configuration overides from the file named 99-config_manager.repo located in the system repository override directory. However, the overrides may be still defined in other repository override files (for example, the default distribution overrides). Empty sections are removed from the configuration override file. Repository ID may contain globs. In this case, the repoid pattern is resolved and the override is removed from all matching sections.

Sets one or more variables.

Variables are loaded from multiple directories. The list of directory paths is taken from the varsdir option. The setvar command stores variables to the last directory in the list (by default /etc/dnf/vars). Variables from this directory are read last and override the values of the same variables defined in previous directories. In other words, the last directory has the highest priority.

Note: The variables releasever_major and releasever_minor are read-only. Their values are generated from the releasever variable.

Removes variables.

Variables are loaded from multiple directories. The list of directory paths is taken from the varsdir option. The unsetvar command removes variables from the last directory in the list (by default /etc/dnf/vars). So, the variable may still exist in another directory in the list (for example, the default distribution value).

Note: The variables releasever_major and releasever_minor are generated automatically and connot be removed.


NOTE:

Override directories are also listed with examples in Drop-in repo directories.


OPTIONS

Allow adding or replacing the repository with the same ID in the existing configuration file.
Allow creation of missing directories.
Specifies the source configuration file with the new repositories.
Set ID for newly created repository.
Allow replacing the existing repository configuration file by new one.
Set the name of the new repository configuration file. The .repo extension is added if it is missing.
Set option in newly created repository.

EXAMPLES

http://example.com/some/additional.repo
Download additional.repo, test it, and put it in repository configuration directory.
http://example.com/different/repo
Create new repo file with http://example.com/different/repo as baseurl and enable it. The repository ID and target file name is generated from baseurl.
http://example.com/different/rep --id=example --set=enabled=0
Create new repo file with http://example.com/different/repo as baseurl. Set repository ID to example and disable it.
Sets override to enable repository identified by repoid1 and disable repository identified by repoid2.
http://proxy.example.com:3128/ repo2.proxy=http://proxy.example.com:3128/
Sets override for proxy option in repositories with repository IDs repo1 and repo2.
Sets override for the gpgcheck option in all repositories whose repository ID ends with -debuginfo.
Remove override for the gpgcheck option in all repositories whose repository ID ends with -debuginfo.
Enables the keepcache main option and sets the maximum size of logger files to 10 mebibytes (10 * 1024 * 1024 bytes).
Removes keepcache and log_size from the main configuration file.
Sets the variables myvar1 and myvar2. Directory for the variables is created if it does not exist.
Removes myvar1 and myvar2 variables.

SEE ALSO

dnf5-conf(5), DNF5 Configuration Reference


AUTHOR

See AUTHORS.md in dnf5 source distribution.

COPYRIGHT

Contributors to the dnf5 project.

June 8, 2024