DNF5-CHANGES-FROM-DNF4(7) dnf5 DNF5-CHANGES-FROM-DNF4(7)
NAME
dnf5-changes-from-dnf4 - Changes from the DNF4
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:
o -- and --no-
o --enable- and --disable-
The options with original names are retained for now as compatibility
aliases.
Examples: --best and --no-best.
Strict behavior
o Options --disable-repo=REPO_ID and --setopt=[REPO_ID.]OPTION=VALUE
now consistently result in an error when provided with an invalid
REPO_ID.
o The behavior is now aligned with the --repo=REPO_ID and
--enable-repo=REPO_ID.
o The strict configuration 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/-6
o Dropped. Now only the ip_resolve configuration option is
available.
--color
o Dropped. Now only the color configuration option is available.
--disableexcludes and --disableexcludepkgs
o Dropped. Now only the disable_excludes configuration option is
available.
--disable, --enable
o Dropped along with the previously existing alternatives
--set-disabled and --set-enabled.
o Currently, this can only be achieved through the
config-manager plugin.
o For example, to disable the fedora repository: dnf
config-manager setopt fedora.enabled=0.
--downloaddir
o Dropped. Now only the --destdir is used for the download
command.
o When downloading packages using the system-upgrade or offline
command, the target path construction now utilizes the
configured installroot and cachedir options.
-e, --errorlevel
o Both the --errorlevel option and errorlevel configuration
option are dropped.
--help-cmd
o Dropped. Now only the -h or --help options are available.
--installroot
o New behavior introduced to define from which place the
configuration and variables are loaded.
o See the installroot documentation for more information.
--noautoremove
o Applicable only for the remove command now. As a workaround
for other commands, you can use
--setopt=clean_requirements_on_remove=False.
--obsoletes
o Dropped. Now only the obsoletes configuration option is
available.
-R, --randomwait
o Dropped.
--rpmverbosity
o Dropped. Now only the rpmverbosity configuration option is
available.
--sec-severity
o Renamed to --advisory-severities.
-v, --verbose
o Not implemented at present. May be added for specific commands
in the future.
--version
o Behavior is different now. See the main man page for more
details.
Newly introduced options
--allow-downgrade
o Along with --no-allow-downgrade, these options enable/disable
the downgrade of dependencies when resolving transactions.
o New respective configuration options have also been created.
o Applicable to install, upgrade, and related commands.
--dump-main-config
o Along with related --dump-repo-config=REPO_ID, these are new
options to print configuration values on the standard output.
--offline
o Store the transaction to be performed offline.
o Applicable to all relevant transactional commands.
o See the Offline command for more information.
--show-new-leaves
o Show newly installed leaf packages and packages that became
leaves after a transaction.
--skip-unavailable
o Allow skipping packages that are not available in
repositories.
o Not to be confused with the skip_if_unavailable configuration
option.
o Applicable to install, upgrade, and related commands.
o See also the strict option deprecation for more information.
--use-host-config
o See 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:
o Before: dnf history Now: dnf history info
o Before: dnf updateinfo Now: dnf updateinfo summary
Changes to individual commands
alias
o Dropped. The command has been replaced by a different
functionality.
o See the Aliases for command line arguments for more
information.
automatic
o Now a DNF5 plugin.
o The specific systemd units, dnf-automatic-download,
dnf-automatic-install, and dnf-automatic-notifyonly, have been
dropped. Only one dnf5-automatic timer is shipped.
o The emitters.send_error_messages config option has been
dropped. DNF5 automatic always informs the user about failed
operations using configured emitters.
o See the Automatic command for more information.
autoremove
o Dropped the positional argument since the use case is
sufficiently covered by the remove command.
o Specific variants of the command, autoremove-n, autoremove-na,
and autoremove-nevra, are not supported anymore.
builddep
o The --spec and --srpm options 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 syntax
dnf builddep pkg1.spec.in --spec no longer has any effect.
config-manager
o New behavior introduced.
o Parameters are replaced by subcommands.
o Examples:
o Before: --add-repo Now: addrepo
o Before: --save --setopt Now: setopt
o Existing repository files are not modified; drop-in override
files are created instead.
o See the config-manager documentation for more information.
debuginfo-install
o Now does not support autoupdate functionality. The permanent
enablement of debug repositories can be achieved using
config-manager command.
distro-sync
o Now when any argument doesn't match an installed package, DNF5
fails. The behavior can be modified by the --skip-unavailable
option.
o Dropped distrosync and distribution-synchronization aliases.
downgrade
o Now when any argument doesn't match an installed package, DNF5
fails. The behavior can be modified by the --skip-unavailable
option.
download
o Option --source was renamed to --srpm.
o Dropped --downloaddir argument, only --destdir is supported
now.
group
o New option --contains-pkgs to filter only groups containing
specific packages.
o Dropped --ids argument as group ids are always in the output
now.
o Dropped group mark install and group mark remove subcommands
in favor of the new --no-packages option for the install and
remove commands.
o E.g. to mark a group as installed without touching any
packages, dnf5 group install --no-packages
command can be used.
o Dropped groupinstall alias. It is replaced by dnf group
install.
o Dropped groupinfo alias. It is replaced by dnf group info.
o Dropped grouplist alias. It is replaced by dnf group list.
o Dropped grouperase alias. It is replaced by dnf group remove.
o Dropped groupremove alias. It is replaced by dnf group remove.
o Dropped groupupdate alias. It is replaced by dnf group
upgrade.
o Dropped groups alias. It is replaced by dnf group.
help
o Dropped. The functionality is replaced by the --help option.
history
o Subcommands are now mandatory: dnf history has to be now dnf5
history list.
o The history commands now only accept transaction ID arguments;
to filter by packages, use the
--contains-pkgs=PACKAGE_NAME,... option, available for list
and info.
o undo subcommand now accepts --ignore-extras and
--ignore-installed like original history replay command.
o userinstalled subcommand was dropped. It is replaced by dnf
repoquery --userinstalled.
o store subcommand now creates a directory with transaction JSON
file instead of a single transaction JSON file directly.
o store subcommand's --output option now accepts a directory
path instead of a file. The default is ./transaction.
o replay subcommand was moved to a standalone replay command,
that now accepts a path to a directory instead of a file path.
The directory can be created with --store option and in
addition to the JSON transaction, it can contain packages,
group and environments used in the transaction.
o info subcommand now prints a separate section for each
selected transaction. It no longer merges all selected
transactions into a single transaction section.
info
o Dropped --all option since this behavior is the default one.
o Dropped --updates option, only --upgrades is available now.
install
o Dropped install-n, install-na and install-nevra command
variants.
list
o Dropped --all option since this behavior is the default one.
o Changed the behavior of the --available option.
o 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.
o When using the --available option, DNF5 considers all
versions available in enabled repositories, irrespective of
the installed version.
o For installed packages print from which repository was the
package installed and if the information is not available
print . This differs to DNF4 which if the information
wasn't available printed @System.
makecache
o Metadata is now stored in different directories, see the
cachedir configuration option changes for more details.
o The --timer option has been dropped in favor of the systemd
OnUnitInactiveSec setting in dnf5-makecache.timer and the
ConditionACPower setting in dnf5-makecache.service.
mark
o Renaming subcommands to be more intuitive: install -> user,
remove -> dependency.
o New weak subcommand to mark a package as a weak dependency.
o Now when any argument doesn't match an installed package, DNF5
fails. The behavior can be modified by the --skip-unavailable
option.
module
o Dropped --all option since this behavior is the default one.
needs-restarting
o Command 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.
o Reboot recommendations are now triggered if any package with a
reboot_suggested advisory has been installed or updated.
o The -s, --services option 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.
o Dropped -r, --reboothint option since this behavior is now the
default one.
o Dropped -u, --useronly option.
offline-distrosync
o Now it's an alias of dnf5 distro-sync --offline.
offline-upgrade
o Now it's an alias of dnf5 upgrade --offline.
remove
o Command no longer removes packages according to provides, but
only based on NEVRA or file provide match.
o Dropped commands remove-n, remove-na, remove-nevra.
o Specific variants of the command, remove-n, remove-na, and
remove-nevra, are not supported anymore.
o Dropped also the related aliases, erase, erase-n, erase-na
and erase-nevra.
repoclosure
o Dropped --pkg option. Positional arguments can now be used to
specify packages to check closure for.
reposync
o Dropped --downloadcomps option. Consider using
--download-metadata option which downloads all available
repository metadata, not only comps groups.
repolist
o The repolist and repoinfo commands are now subcommands of the
repo command: repo list and repo info.
o Original commands still exist as compatibility aliases.
o Options -v and --verbose have been removed. The functionality
is replaced by the repo info command (already in DNF4 as
repoinfo).
o When no repositories are configured, empty output is now
provided instead of displaying "No repositories available".
repoquery
o Dropped: -a/--all, --alldeps, --nevra options. Their behavior
is and has been the default for both DNF4 and DNF5, so the
options are no longer needed.
o Dropped: --envra, --nvr, --unsatisfied options. They are no
longer supported.
o Dropped: repoquery-n, repoquery-na and repoquery-nevra command
variants.
o Dropped: --archlist alias for --arch.
o Dropped: -f alias for --file. Also, the arguments to --file
are separated by commas instead of spaces.
o Moved --groupmember option to the info and list subcommands of
the group and advisory commands, renaming it to
--contains-pkgs.
o --queryformat, --qf no longer prints an additional newline at
the end of each formatted string, bringing it closer to the
behavior of rpm --query.
o --queryformat no longer supports size tag because it was
printing install size for installed packages and download size
for not-installed packages, which could be confusing.
o Option --source was renamed to --sourcerpm, and it now matches
queryformat's sourcerpm tag.
o Option --resolve was 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.
o For example, dnf rq --resolve --requires glibc is now dnf rq
--providers-of=requires glibc.
o See the Repoquery command for more information.
system-upgrade
o Moved from a plugin to a built-in command.
upgrade
o New option --minimal.
o upgrade-minimal still exists as a compatibility alias for
upgrade --minimal.
o Now when any argument doesn't match an installed package, DNF5
fails. The behavior can be modified by the --skip-unavailable
option.
o Dropped upgrade-to and localupdate aliases.
o Dropped --skip-broken option, as it was already available in
DNF4 only for compatibility reasons with YUM, but has no
effect.
o Instead, decisions about package selection and handling
dependency issues are based on the best or no-best options.
updateinfo
o Renamed the command to advisory
o updateinfo still exists as a compatibility alias.
o Subcommands are now mandatory: dnf updateinfo is now dnf5
advisory summary.
o Options --summary, --list and --info have been changed to
subcommands. See dnf5 advisory --help.
o Option --sec-severity has been renamed to
--advisory-severities=ADVISORY_SEVERITY,....
o The advisory commands now only accept advisory IDs; to filter
by packages, use the --contains-pkgs=PACKAGE_NAME,... option.
o Dropped deprecated aliases: list-updateinfo, list-security,
list-sec, info-updateinfo, info-security, info-sec,
summary-updateinfo.
o Dropped upif alias.
versionlock
o New format of the configuration file.
o 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 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:
1. It allows the solver to skip uninstallable packages to resolve
dependency problems.
2. It permits DNF to skip unavailable packages (mostly for the
install command).
To address this, the functionality has been split into two
configuration options:
o skip_broken for uninstallable packages.
o skip_unavailable for 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.
Changes to individual options
best
o Default value is changed to true.
o The new default value ensures that important updates will not
be skipped and issues in distribution will be reported
earlier.
cachedir
o The default user cached dir is now at ~/.cache/libdnf5.
o The default root cache directory, configured by the
system_cachedir option, is now /var/cache/libdnf5.
o Users no longer access the root's cache directly; instead,
metadata is copied to the user's location if it's empty or
invalid.
o For additional information, refer to the Caching man page.
cacheonly
o The option was changed from bool to enum with options all,
metadata and none.
o This enables users to specify whether to use the cache
exclusively for metadata or for both metadata and packages.
deltarpm
o Default value is changed to false.
o The support for delta RPMs is not implemented for now.
disable_excludes
o To disable all configuration file excludes, the * glob
character is used now instead of the all to unify the behavior
with query objects on the API.
keepcache
o The behavior has been slightly modified, see the Caching man
page for more information.
optional_metadata_types
o Default value is now: comps,updateinfo.
o Supported values are now extended to the following list:
comps, filelists, other, presto, updateinfo.
Newly introduced configuration options
allow_downgrade
o New option used to enable or disable downgrade of dependencies
when resolving transaction.
skip_broken, skip_unavailable, strict
o New options skip_broken, skip_unavailable were added due to
deprecation of strict option.
o See the strict deprecation above.
Dropped configuration options
arch and basearch
o It is no longer possible to change the detected architecute in
configuration files.
o See the dnf5-forcearch(7), Forcearch parameter for overriding
architecture.
errorlevel
o The option was deprecated in dnf < 5 and is dropped now.
AUTHOR
See AUTHORS.md in dnf5 source distribution.
COPYRIGHT
Contributors to the dnf5 project.
April 18, 2025 DNF5-CHANGES-FROM-DNF4(7)