Config-manager Command
Synopsis
dnf5 config-manager <subcommand> [options] [arguments]
Description
Manages main configuration, repositories configuration, and variables.
Subcommands
addrepo --from-repofile=REPO_CONFIGURATION_FILE_URL [--create-missing-dir] [--overwrite] [--save-filename=FILENAME]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-filenameoption, otherwise it is taken from the source specification. If the.repoextension is missing from the destination filename, it will be added.The destination directory path is the first path stored in the
reposdiroption (by default/etc/yum.repos.d). Overwriting/replacing an existing file can be enabled using the--overwriteoption. 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.addrepo [--id=REPO_ID] <--set=REPO_OPTION=VALUE>+ [--add-or-replace] [--create-missing-dir] [--overwrite] [--save-filename=FILENAME]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--idoption, otherwise it is generated from the URL. The destination file name can be defined using the--save-filenameoption, otherwise it is set to the repository ID. If the.repoextension is missing from the destination filename, it will be added.The destination directory path is the first path stored in the
reposdiroption (by default/etc/yum.repos.d). Overwriting/replacing an existing file can be enabled using the--overwriteoption. Modifying an existing file can be enabled using the--add-or-replaceoption. 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.setopt [--create-missing-dir] <[repoid.]option_name=value>+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
setoptcommand writes the repositories configuration overrides to a file named99-config_manager.repolocated 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 thesetoptcommand resolves therepoidpattern, and overrides are set for each matching repository independently. This means repositories added later will not be affected by these overrides.unsetopt <[repoid.]option_name>+Removes options from the main configuration file and from the repositories configuration override file.
The
unsetoptcommand 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
unsetoptcommand removes repository configuration overides from the file named99-config_manager.repolocated 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, therepoidpattern is resolved and the override is removed from all matching sections.setvar [--create-missing-dir] <variable_name=value>+Sets one or more variables.
Variables are loaded from multiple directories. The list of directory paths is taken from the
varsdiroption. Thesetvarcommand 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_majorandreleasever_minorare read-only. Their values are generated from thereleasevervariable.unsetvar <variable>+Removes variables.
Variables are loaded from multiple directories. The list of directory paths is taken from the
varsdiroption. Theunsetvarcommand 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_majorandreleasever_minorare generated automatically and connot be removed.
Note
Override directories are also listed with examples in Drop-in repo directories.
Options
--add-or-replaceAllow adding or replacing the repository with the same ID in the existing configuration file.
--create-missing-dirAllow creation of missing directories.
--from-repofile=REPO_CONFIGURATION_FILE_URLSpecifies the source configuration file with the new repositories.
--id=REPO_IDSet ID for newly created repository.
--overwriteAllow replacing the existing repository configuration file by new one.
--save-filename=FILENAMESet the name of the new repository configuration file. The
.repoextension is added if it is missing.--set=REPO_OPTION=VALUESet option in newly created repository.
Examples
dnf5 config-manager addrepo --from-repofile=http://example.com/some/additional.repoDownload
additional.repo, test it, and put it in repository configuration directory.dnf5 config-manager addrepo --set=baseurl=http://example.com/different/repoCreate new repo file with
http://example.com/different/repoasbaseurland enable it. The repository ID and target file name is generated frombaseurl.dnf5 config-manager addrepo --set=baseurl=http://example.com/different/rep --id=example --set=enabled=0Create new repo file with
http://example.com/different/repoasbaseurl. Set repository ID toexampleand disable it.dnf5 config-manager setopt repoid1.enabled=1 repoid2.enabled=0Sets override to enable repository identified by
repoid1and disable repository identified byrepoid2.dnf5 config-manager setopt repo1.proxy=http://proxy.example.com:3128/ repo2.proxy=http://proxy.example.com:3128/Sets override for
proxyoption in repositories with repository IDsrepo1andrepo2.dnf5 config-manager setopt '*-debuginfo.pkg_gpgcheck=0'Sets override for the
pkg_gpgcheckoption in all repositories whose repository ID ends with-debuginfo.dnf5 config-manager unsetopt '*-debuginfo.pkg_gpgcheck'Remove override for the
pkg_gpgcheckoption in all repositories whose repository ID ends with-debuginfo.dnf5 config-manager setopt keepcache=1 log_size=10MEnables the
keepcachemain option and sets the maximum size of logger files to 10 mebibytes (10 * 1024 * 1024 bytes).dnf5 config-manager unsetopt keepcache log_sizeRemoves
keepcacheandlog_sizefrom the main configuration file.dnf5 config-manager setvar --create-missing-dir myvar1=value1 myvar2=value2Sets the variables
myvar1andmyvar2. Directory for the variables is created if it does not exist.dnf5 config-manager unsetvar myvar1 myvar2Removes
myvar1andmyvar2variables.
See Also
- Configuration:
- dnf5-conf(5), DNF5 Configuration Reference