Changes between DNF and DNF5
This chapter describes the differences between DNF5 and DNF.
Changes on the CLI
Options
Global options scoping
Options that cannot be applied to all commands or may be applicable but have no effect are removed from general options and implemented only for related commands.
Examples: --best, --no-best are only relevant to several transaction commands.
Options renaming
Renaming boolean options to the following formats:
--<option>and--no-<option>
--enable-<option>and--disable-<option>
The options with original names are retained for now as compatibility aliases.
Examples: --best and --no-best.
Strict behavior
Options
--disable-repo=REPO_IDand--setopt=[REPO_ID.]OPTION=VALUEnow consistently result in an error when provided with an invalidREPO_ID.The behavior is now aligned with the
--repo=REPO_IDand--enable-repo=REPO_ID.The
strictconfiguration option is no longer considered, see the strict option deprecation for more information.
No value separator after short options
Short options do not have a separator between the option name and the option
value. E.g. dnf -x package is equivalent to dnf --exclude package and
dnf --exclude=package long forms. But dnf -x=package means
dnf --exclude =package.
Changes to individual options
-4/-6Dropped. Now only the
ip_resolveconfiguration option is available.
--disableexcludesand--disableexcludepkgsDropped. Now only the
disable_excludesconfiguration option is available.
--disable, --enableDropped along with the previously existing alternatives
--set-disabledand--set-enabled.Currently, this can only be achieved through the config-manager plugin.
For example, to disable the
fedorarepository:dnf config-manager setopt fedora.enabled=0.
--downloaddirDropped. Now only the
--destdiris used for thedownloadcommand.When downloading packages using the
system-upgradeorofflinecommand, the target path construction now utilizes the configuredinstallrootandcachediroptions.
-e, --errorlevelBoth the
--errorleveloption anderrorlevelconfiguration option are dropped.
--help-cmdDropped. Now only the
-hor--helpoptions are available.
--installrootNew behavior introduced to define from which place the configuration and variables are loaded.
See the installroot documentation for more information.
--noautoremoveApplicable only for the
removecommand now. As a workaround for other commands, you can use--setopt=clean_requirements_on_remove=False.
--obsoletesDropped. Now only the
obsoletesconfiguration option is available.
-R, --randomwaitDropped.
--rpmverbosityDropped. Now only the
rpmverbosityconfiguration option is available.
--sec-severityRenamed to
--advisory-severities.
-v, --verboseNot implemented at present. May be added for specific commands in the future.
--versionBehavior is different now. See the main man page for more details.
Newly introduced options
--allow-downgradeAlong with
--no-allow-downgrade, these options enable/disable the downgrade of dependencies when resolving transactions.New respective configuration options have also been created.
Applicable to
install,upgrade, and related commands.
--dump-main-configAlong with related
--dump-repo-config=REPO_ID, these are new options to print configuration values on the standard output.
--offlineStore the transaction to be performed offline.
Applicable to all relevant transactional commands.
See the Offline command for more information.
--show-new-leavesShow newly installed leaf packages and packages that became leaves after a transaction.
--skip-unavailableAllow skipping packages that are not available in repositories.
Not to be confused with the skip_if_unavailable configuration option.
Applicable to
install,upgrade, and related commands.See also the strict option deprecation for more information.
--use-host-configSee the main man page for more details.
Commands
Optional subcommands
Commands cannot have optional subcommands. Optional subcommands were ambiguous, making it unclear whether the input was intended as a command argument or a subcommand. Subcommands are now mandatory if present.
- Examples:
Before:
dnf history <transaction ID>Now:dnf history info <transaction ID>Before:
dnf updateinfoNow:dnf updateinfo summary
Changes to individual commands
aliasDropped. The command has been replaced by a different functionality.
See the Aliases for command line arguments for more information.
automaticNow a DNF5 plugin.
The specific systemd units,
dnf-automatic-download,dnf-automatic-install, anddnf-automatic-notifyonly, have been dropped. Only onednf5-automatictimer is shipped.The
emitters.send_error_messagesconfig option has been dropped. DNF5 automatic always informs the user about failed operations using configured emitters.See the Automatic command for more information.
autoremoveDropped the
<spec>positional argument since the use case is sufficiently covered by theremovecommand.Specific variants of the command,
autoremove-n,autoremove-na, andautoremove-nevra, are not supported anymore.
builddepThe
--specand--srpmoptions only apply to arguments that follow them. This allows for use cases that combine spec files and source RPMs (e.g.,dnf5 builddep --spec pkg1.spec.in --srpm pkg2.src.rpm). However, the previously supported syntaxdnf builddep pkg1.spec.in --specno longer has any effect.
config-managerNew behavior introduced.
Parameters are replaced by subcommands.
Examples:
Before:
--add-repoNow:addrepoBefore:
--save --setoptNow:setopt
Existing repository files are not modified; drop-in override files are created instead.
Dropped the
--dumpoption:To dump main configuration options use
dnf5 --dump-main-configcommand.To dump a repository configuration use
dnf5 --dump-repo-config=REPO_IDcommand.
Dropped the
--dump-variablesoption, usednf5 --dump-variablescommand instead.See the config-manager documentation for more information.
debuginfo-installNow does not support autoupdate functionality. The permanent enablement of debug repositories can be achieved using config-manager command.
distro-syncNow when any argument doesn’t match an installed package, DNF5 fails. The behavior can be modified by the
--skip-unavailableoption.Dropped
distrosyncanddistribution-synchronizationaliases.
downgradeNow when any argument doesn’t match an installed package, DNF5 fails. The behavior can be modified by the
--skip-unavailableoption.
downloadOption
--sourcewas renamed to--srpm.Dropped
--downloaddirargument, only--destdiris supported now.
groupNew option
--contains-pkgsto filter only groups containing specific packages.Dropped
--idsargument as group ids are always in the output now.Dropped
group mark installandgroup mark removesubcommands in favor of the new--no-packagesoption for theinstallandremovecommands.E.g. to mark a group as installed without touching any packages,
dnf5 group install --no-packages <group_id>command can be used.
Dropped
groupinstallalias. It is replaced bydnf group install.Dropped
groupinfoalias. It is replaced bydnf group info.Dropped
grouplistalias. It is replaced bydnf group list.Dropped
grouperasealias. It is replaced bydnf group remove.Dropped
groupremovealias. It is replaced bydnf group remove.Dropped
groupupdatealias. It is replaced bydnf group upgrade.Dropped
groupsalias. It is replaced bydnf group.
helpDropped. The functionality is replaced by the
--helpoption.
historySubcommands are now mandatory:
dnf historyhas to be nowdnf5 history list.The
historycommands now only accept transaction ID arguments; to filter by packages, use the--contains-pkgs=PACKAGE_NAME,...option, available forlistandinfo.undosubcommand now accepts--ignore-extrasand--ignore-installedlike originalhistory replaycommand.userinstalledsubcommand was dropped. It is replaced bydnf repoquery --userinstalled.storesubcommand now creates a directory with transaction JSON file instead of a single transaction JSON file directly.storesubcommand’s--outputoption now accepts a directory path instead of a file. The default is./transaction.replaysubcommand was moved to a standalonereplaycommand, that now accepts a path to a directory instead of a file path. The directory can be created with--storeoption and in addition to the JSON transaction, it can contain packages, group and environments used in the transaction.infosubcommand now prints a separate section for each selected transaction. It no longer merges all selected transactions into a single transaction section.
infoDropped
--alloption since this behavior is the default one.Dropped
--updatesoption, only--upgradesis available now.
installDropped
install-n,install-naandinstall-nevracommand variants.
listDropped
--alloption since this behavior is the default one.Changed the behavior of the
--availableoption.In DNF4, only packages not installed or with higher versions were listed. This behavior remains unchanged when the option is not used, reducing duplications in the “Installed Packages” section.
When using the
--availableoption, DNF5 considers all versions available in enabled repositories, irrespective of the installed version.
For installed packages print from which repository was the package installed and if the information is not available print
<unknown>. This differs to DNF4 which if the information wasn’t available printed@System.
makecacheMetadata is now stored in different directories, see the
cachedirconfiguration option changes for more details.The
--timeroption has been dropped in favor of the systemdOnUnitInactiveSecsetting indnf5-makecache.timerand theConditionACPowersetting indnf5-makecache.service.Now tries to avoid downloading whenever possible (e.g. when the local metadata hasn’t expired yet or when the metadata timestamp hasn’t changed). Pass
--refreshto force refreshing of metadata. This was the intended behavior in DNF4 also, butdnf4 makecachealways refreshed repositories due to a bug.
markRenaming subcommands to be more intuitive:
install->user,remove->dependency.New
weaksubcommand to mark a package as a weak dependency.Now when any argument doesn’t match an installed package, DNF5 fails. The behavior can be modified by the
--skip-unavailableoption.
moduleDropped
--alloption since this behavior is the default one.
needs-restartingCommand no longer scans for open files to determine outdated files still in use. The default behavior now aligns with DNF 4’s
--reboothint, suggesting a system reboot depending on updated packages since the last boot.Reboot recommendations are now triggered if any package with a
reboot_suggestedadvisory has been installed or updated.The
-s, --servicesoption no longer scans for open files. Instead, restarting a service is recommended if any dependency of the service-providing package or the package itself has been updated since the service started.Dropped
-r, --reboothintoption since this behavior is now the default one.Dropped
-u, --useronlyoption.
offline-distrosyncNow it’s an alias of
dnf5 distro-sync --offline.
offline-upgradeNow it’s an alias of
dnf5 upgrade --offline.
removeCommand no longer removes packages according to provides, but only based on NEVRA or file provide match.
Dropped commands
remove-n,remove-na,remove-nevra.Specific variants of the command,
remove-n,remove-na, andremove-nevra, are not supported anymore.Dropped also the related aliases,
erase,erase-n,erase-naanderase-nevra.
repoclosureDropped
--pkgoption. Positional arguments can now be used to specify packages to check closure for.
reposyncDropped
--downloadcompsoption. Consider using--download-metadataoption which downloads all available repository metadata, not only comps groups.
repolistThe
repolistandrepoinfocommands are now subcommands of therepocommand:repo listandrepo info.Original commands still exist as compatibility aliases.
Options
-vand--verbosehave been removed. The functionality is replaced by therepo infocommand (already in DNF4 asrepoinfo).When no repositories are configured, empty output is now provided instead of displaying “No repositories available”.
repoqueryDropped:
-a/--all,--alldeps,--nevraoptions. Their behavior is and has been the default for both DNF4 and DNF5, so the options are no longer needed.Dropped:
--envra,--nvr,--unsatisfiedoptions. They are no longer supported.Dropped:
repoquery-n,repoquery-naandrepoquery-nevracommand variants.Dropped:
--archlistalias for--arch.Dropped:
-falias for--file. Also, the arguments to--fileare separated by commas instead of spaces.Moved
--groupmemberoption to theinfoandlistsubcommands of thegroupandadvisorycommands, renaming it to--contains-pkgs.--queryformat, --qfno longer prints an additional newline at the end of each formatted string, bringing it closer to the behavior ofrpm --query. To get the newline, use an explicit\nsequence in the formatting string.--queryformatno longer supportssizetag because it was printing install size for installed packages and download size for not-installed packages, which could be confusing.Option
--sourcewas renamed to--sourcerpm, and it now matches queryformat’ssourcerpmtag.Option
--resolvewas changed to--providers-of=PACKAGE_ATTRIBUTE. It no longer interacts with the formatting options such as--requires,--provides,--suggests, etc. Instead, it takes the PACKAGE_ATTRIBUTE value directly.For example,
dnf rq --resolve --requires glibcis nowdnf rq --providers-of=requires glibc.
See the Repoquery command for more information.
system-upgradeMoved from a plugin to a built-in command.
upgradeNew option
--minimal.upgrade-minimalstill exists as a compatibility alias forupgrade --minimal.
Now when any argument doesn’t match an installed package, DNF5 fails. The behavior can be modified by the
--skip-unavailableoption.Dropped
upgrade-toandlocalupdatealiases.Dropped
--skip-brokenoption, as it was already available in DNF4 only for compatibility reasons with YUM, but has no effect.
updateinfoRenamed the command to
advisoryupdateinfostill exists as a compatibility alias.
Subcommands are now mandatory:
dnf updateinfois nowdnf5 advisory summary.Options
--summary,--listand--infohave been changed to subcommands. Seednf5 advisory --help.Option
--sec-severityhas been renamed to--advisory-severities=ADVISORY_SEVERITY,....The
advisorycommands now only accept advisory IDs; to filter by packages, use the--contains-pkgs=PACKAGE_NAME,...option.Dropped deprecated aliases:
list-updateinfo,list-security,list-sec,info-updateinfo,info-security,info-sec,summary-updateinfo.Dropped
upifalias.
versionlockNew format of the configuration file.
See the Versionlock command for more information.
Changes on the API
PackageSet::operator[]
It was removed due to insufficient O(n^2) performance. Use PackageSet iterator to access the data instead.
Package::get_epoch()
The return type was changed from unsigned long to std::string.
DNF: Package.size, libdnf: dnf_package_get_size()
The return value was ambiguous, returning either package or install size. Use Package::get_download_size() and Package::get_install_size() instead.
dnf_sack_set_installonly, dnf_sack_get_installonly, dnf_sack_set_installonly_limit, dnf_sack_get_installonly_limit
The functions were dropped as unneeded. The installonly packages are taken directly from main Conf in Base.
Query::filter() - HY_PKG_UPGRADES_BY_PRIORITY, HY_PKG_OBSOLETES_BY_PRIORITY, HY_PKG_LATEST_PER_ARCH_BY_PRIORITY
The priority filter was separated into a standalone method.
Combine query.filter_priority() with query.filter_latest_evr() or another filter to achieve the original
functionality.
Query::filter() - HY_PKG_LATEST
The filter was replaced with filter_latest_evr() which has the same behavior as HY_PKG_LATEST_PER_ARCH
ConfigMain::proxy_auth_method() and ConfigRepo::proxy_auth_method()
The return types were changed. OptionEnum<std::string> was replaced by OptionStringSet.
A combination of several authentication methods (for example “basic” and “digest”) can now be used.
This allows using a list of authentication methods in configuration files and the DNF5 command line
“–setopt=proxy_auth_method=”.
Changes to configuration
Deprecation of the strict option
strict configuration option is now deprecated due to its dual functionality:
It allows the solver to skip uninstallable packages to resolve dependency problems.
It permits DNF to skip unavailable packages (mostly for the
installcommand).
To address this, the functionality has been split into two configuration options:
skip_brokenfor uninstallable packages.
skip_unavailablefor packages not present in repositories.
Additionally, corresponding command-line options --skip-broken and --skip-unavailable have been introduced for commands where applicable.
Deprecation of the metadata_timer_sync option
The metadata_timer_sync configuration option is now obsoleted by the dnf5-makecache.timer systemd timer settings.
Deprecation of the retries option
The retries configuration option is now deprecated. In dnf4, despite being documented as the number of retries for downloading packages, it was only used to limit the number of package re-downloads due to deltarpm errors. Deltarpm support is currently not planned for DNF5.
Deprecation of the deltarpm and deltarpm_percentage options
Support for delta RPMs is not planned for DNF5.
Changes to individual options
bestDefault value is changed to
true.The new default value ensures that important updates will not be skipped and issues in distribution will be reported earlier.
cachedirThe default user cached dir is now at
~/.cache/libdnf5.The default root cache directory, configured by the
system_cachediroption, is now/var/cache/libdnf5.Users no longer access the root’s cache directly; instead, metadata is copied to the user’s location if it’s empty or invalid.
For additional information, refer to the Caching man page.
cacheonlyThe option was changed from
booltoenumwith optionsall,metadataandnone.This enables users to specify whether to use the cache exclusively for metadata or for both metadata and packages.
disable_excludesTo disable all configuration file excludes, the
*glob character is used now instead of theallto unify the behavior with query objects on the API.
keepcacheThe behavior has been slightly modified, see the Caching man page for more information.
optional_metadata_typesDefault value is now:
comps,updateinfo.Supported values are now extended to the following list:
comps,filelists,other,presto,updateinfo.
Newly introduced configuration options
allow_downgradeNew option used to enable or disable downgrade of dependencies when resolving transaction.
skip_broken,skip_unavailable,strictNew options
skip_broken,skip_unavailablewere added due to deprecation ofstrictoption.See the strict deprecation above.
Dropped configuration options
archandbasearchIt is no longer possible to change the detected architecute in configuration files.
See the dnf5-forcearch(7), Forcearch parameter for overriding architecture.
errorlevelThe option was deprecated in dnf < 5 and is dropped now.