DNF System Manual
DNF System Manual
Synopsis
dnf [options] <command> [<args>...]
Description
`DNF`_ is the next upcoming major version of `YUM`_, a package manager for RPM-
based Linux distributions. It roughly maintains CLI compatibility with YUM and
defines a strict API for extensions and plugins.
Plugins can modify or extend features of DNF or provide additional CLI commands on
top of those mentioned below. If you know the name of such a command (including
commands mentioned below), you may find/install the package which provides it using
the appropriate virtual provide in the form of dnf-command(<alias>), where <alias>
is the name of the command; e.g.``dnf install ‘dnf-command(versionlock)’`` installs
a versionlock plugin. This approach also applies to specifying dependencies of
packages that require a particular DNF command.
Return values:
alias
autoremove
check
check-update
clean
deplist
distro-sync
downgrade
group
help
history
info
install
list
makecache
mark
module
provides
reinstall
remove
repoinfo
repolist
repoquery
repository-packages
search
shell
swap
updateinfo
upgrade
upgrade-minimal
upgrade-to
Additional information:
Options
Specifying Packages
Specifying Exact Versions of Packages
Specifying Provides
Specifying Groups
Specifying Transactions
Metadata Synchronization
Configuration Files Replacement Policy
Files
See Also
Options
-4
Resolve to IPv4 addresses only.
-6
Resolve to IPv6 addresses only.
--advisory=<advisory>, --advisories=<advisory>
Include packages corresponding to the advisory ID, Eg. FEDORA-2201-123. Applicable
for the install, repoquery, updateinfo and upgrade commands.
--allowerasing
Allow erasing of installed packages to resolve dependencies. This option could be
used as an alternative to the yum swap command where packages to remove are not
explicitly defined.
--assumeno
Automatically answer no for all questions.
-b, --best
Try the best available package versions in transactions. Specifically during dnf
upgrade, which by default skips over updates that can not be installed for
dependency reasons, the switch forces DNF to only consider the latest packages.
When running into packages with broken dependencies, DNF will fail giving a reason
why the latest version can not be installed.
--bugfix
Include packages that fix a bugfix issue. Applicable for the install, repoquery,
updateinfo and upgrade commands.
--bz=<bugzilla>, --bzs=<bugzilla>
Include packages that fix a Bugzilla ID, Eg. 123123. Applicable for the install,
repoquery, updateinfo and upgrade commands.
-C, --cacheonly
Run entirely from system cache, don’t update the cache and use it even in case it
is expired.
DNF uses a separate cache for each user under which it executes. The cache for the
root user is called the system cache. This switch allows a regular user read-only
access to the system cache, which usually is more fresh than the user’s and thus he
does not have to wait for metadata sync.
--color=<color>
Control whether color is used in terminal output. Valid values are always, never
and auto (default).
--comment=<comment>
Add a comment to the transaction history.
-c <config file>, --config=<config file>
Configuration file location.
--cve=<cves>, --cves=<cves>
Include packages that fix a CVE (Common Vulnerabilities and Exposures) ID
(http://cve.mitre.org/about/), Eg. CVE-2201-0123. Applicable for the install,
repoquery, updateinfo, and upgrade commands.
-d <debug level>, --debuglevel=<debug level>
Debugging output level. This is an integer value between 0 (no additional
information strings) and 10 (shows all debugging information, even that not
understandable to the user), default is 2. Deprecated, use -v instead.
--debugsolver
Dump data aiding in dependency solver debugging into ./debugdata.
--disableexcludes=[all|main|<repoid>], --disableexcludepkgs=[all|main|<repoid>]
Disable the configuration file excludes. Takes one of the following three options:
Installroot examples:
This option also displays capabilities that the package obsoletes when used
together with the repoquery command.
-q, --quiet
In combination with a non-interactive command, shows just the relevant content.
Suppresses messages notifying about the current state or actions of DNF.
-R <minutes>, --randomwait=<minutes>
Maximum command wait time.
--refresh
Set metadata as expired before running the command.
--releasever=<release>
Configure DNF as if the distribution release was <release>. This can affect cache
paths, values in configuration files and mirrorlist URLs.
--repofrompath <repo>,<path/url>
Specify a repository to add to the repositories for this query. This option can be
used multiple times.
The repository label is specified by <repo>.
The path or url to the repository is specified by <path/url>. It is the same path
as a baseurl and can be also enriched by the repo variables.
The configuration for the repository can be adjusted using
--setopt=<repo>.<option>=<value>.
If you want to view only packages from this repository, combine this with the
--repo=<repo> or --disablerepo="*" switches.
--repo=<repoid>, --repoid=<repoid>
Enable just specific repositories by an id or a glob. Can be used multiple times
with accumulative effect. It is basically a shortcut for --disablerepo="*"
--enablerepo=<repoid> and is mutually exclusive with the --disablerepo option.
--rpmverbosity=<name>
RPM debug scriptlet output level. Sets the debug level to <name> for RPM
scriptlets. For available levels, see the rpmverbosity configuration option.
--sec-severity=<severity>, --secseverity=<severity>
Includes packages that provide a fix for an issue of the specified severity.
Applicable for the install, repoquery, updateinfo and upgrade commands.
--security
Includes packages that provide a fix for a security issue. Applicable for the
upgrade command.
--setopt=<option>=<value>
Override a configuration option from the configuration file. To override
configuration options for repositories, use repoid.option for the <option>. Values
for configuration options like excludepkgs, includepkgs, installonlypkgs and
tsflags are appended to the original value, they do not override it. However,
specifying an empty value (e.g. --setopt=tsflags=) will clear the option.
--skip-broken
Resolve depsolve problems by removing packages that are causing problems from the
transaction. It is an alias for the strict configuration option with value False.
Additionally, with the enable and disable module subcommands it allows one to
perform an action even in case of broken modular dependencies.
--showduplicates
Show duplicate packages in repositories. Applicable for the list and search
commands.
-v, --verbose
Verbose operation, show debug messages.
--version
Show DNF version and exit.
-y, --assumeyes
Automatically answer yes for all questions.
List options are comma-separated. Command-line options override respective settings
from configuration files.
Commands
For an explanation of <package-spec> and <package-file-spec> see Specifying
Packages.
Alias Command
Allows the user to define and manage a list of aliases (in the form <name=value>),
which can be then used as dnf commands to abbreviate longer command sequences. For
examples on using the alias command, see Alias Examples. For examples on the alias
processing, see Alias Processing Examples.
To use an alias (name=value), the name must be placed as the first “command” (e.g.
the first argument that is not an option). It is then replaced by its value and the
resulting sequence is again searched for aliases. The alias processing stops when
the first found command is not a name of any alias.
Also, like in shell aliases, if the result starts with a \, the alias processing
will stop.
Optionally, there is the enabled option in the [main] section defaulting to True.
This can be set for each file separately in the respective file, or globally for
all aliases in the ALIASES.conf file.
List aliases with their final result. The [<alias>...] parameter further limits the
result to only those aliases matching it.
dnf alias [options] add <name=value>...
Delete aliases.
Alias Examples
dnf alias list
Lists all defined aliases.
dnf alias add rm=remove
Adds a new command alias called rm which works the same as the remove command.
dnf alias add upgrade="\upgrade --skip-broken --disableexcludes=all --obsoletes"
Adds a new command alias called upgrade which works the same as the upgrade
command, with additional options. Note that the original upgrade command is
prefixed with a \ to prevent an infinite loop in alias processing.
Alias Processing Examples
If there are defined aliases in=install and FORCE="--skip-broken
--disableexcludes=all":
Removes all “leaf” packages from the system that were originally installed as
dependencies of user-installed packages, but which are no longer required by any
such package.
Packages listed in installonlypkgs are never automatically removed by this command.
There are also a few specific autoremove commands autoremove-n, autoremove-na and
autoremove-nevra that allow the specification of an exact argument in the NEVRA
(name-epoch:version-release.architecture) format.
This command by default does not force a sync of expired metadata. See also
Metadata Synchronization.
Check Command
dnf [options] check [--dependencies] [--duplicates] [--obsoleted] [--provides]
Checks the local packagedb and produces information on any problems it finds. You
can limit the checks to be performed by using the --dependencies, --duplicates,
--obsoleted and --provides options (the default is to check everything).
Check-Update Command
dnf [options] check-update [--changelogs] [<package-file-spec>...]
Please note that having a specific newer version available for an installed package
(and reported by check-update) does not imply that subsequent dnf upgrade will
install it. The difference is that dnf upgrade has restrictions (like package
dependencies being satisfied) to take into account.
Clean Command
Performs cleanup of temporary files kept for repositories. This includes any such
data left behind from disabled or removed repositories as well as for different
distribution release versions.
Distribution-Synchronization command
dnf distribution-synchronization
Deprecated alias for the Distro-Sync command.
Downgrade Command
dnf [options] downgrade <package-spec>...
Downgrades the specified packages to the highest installable package of all known
lower versions if possible. When version is given and is lower than version of
installed package then it downgrades to target version.
Erase Command
dnf [options] erase <spec>...
Deprecated alias for the Remove Command.
Group Command
Groups are virtual collections of packages. DNF keeps track of groups that the user
selected (“marked”) installed and can manipulate the comprising packages with
simple commands.
Groups Command
dnf [options] groups
Deprecated alias for the Group Command.
Help Command
dnf help [<command>]
Displays the help text for all commands. If given a command name then only displays
help for that particular command.
History Command
The history command allows the user to view what has happened in past transactions
and act according to this information (assuming the history_record configuration
option is set).
Info Command
dnf [options] info [<package-file-spec>...]
Lists description and summary information about installed and available packages.
This command by default does not force a sync of expired metadata. See also
Metadata Synchronization.
Install Command
dnf [options] install <spec>...
Makes sure that the given packages and their dependencies are installed on the
system. Each <spec> can be either a <package-spec>, or a @<module-spec>, or a
@<group-spec>. See Install Examples. If a given package or provide cannot be (and
is not already) installed, the exit code will be non-zero. If the <spec> matches
both a @<module-spec> and a @<group-spec>, only the module is installed.
When <package-spec> to specify the exact version of the package is given, DNF will
install the desired version, no matter which version of the package is already
installed. The former version of the package will be removed in the case of non-
installonly package.
There are also a few specific install commands install-n, install-na and install-
nevra that allow the specification of an exact argument in the NEVRA format.
Install Examples
dnf install tito
Install the tito package (tito is the package name).
dnf install ~/Downloads/tito-0.6.2-1.fc22.noarch.rpm
Install a local rpm file tito-0.6.2-1.fc22.noarch.rpm from the ~/Downloads/
directory.
dnf install tito-0.5.6-1.fc22
Install the package with a specific version. If the package is already installed it
will automatically try to downgrade or upgrade to the specific version.
dnf --best install tito
Install the latest available version of the package. If the package is already
installed it will try to automatically upgrade to the latest version. If the latest
version of the package cannot be installed, the installation will fail.
dnf install vim
DNF will automatically recognize that vim is not a package name, but will look up
and install a package that provides vim with all the required dependencies. Note:
Package name match has precedence over package provides match.
dnf install
https://kojipkgs.fedoraproject.org//packages/tito/0.6.0/1.fc22/noarch/tito-0.6.0-
1.fc22.noarch.rpm
Install a package directly from a URL.
dnf install '@docker'
Install all default profiles of module ‘docker’ and their RPMs. Module streams get
enabled accordingly.
dnf install '@Web Server'
Install the ‘Web Server’ environmental group.
dnf install /usr/bin/rpmsign
Install a package that provides the /usr/bin/rpmsign file.
dnf -y install tito --setopt=install_weak_deps=False
Install the tito package (tito is the package name) without weak deps. Weak deps
are not required for core functionality of the package, but they enhance the
original package (like extended documentation, plugins, additional functions,
etc.).
dnf install --advisory=FEDORA-2018-b7b99fe852 \*
Install all packages that belong to the “FEDORA-2018-b7b99fe852” advisory.
List Command
Prints lists of packages depending on the packages’ relation to the system. A
package is installed if it is present in the RPMDB, and it is available if it is
not installed but is present in a repository that DNF knows about. The list command
can also limit the displayed packages according to specific criteria, e.g. to only
those that update an installed package. The exclude option in the configuration
file can influence the result, but if the --disableexcludes command line option is
used, it ensures that all installed packages will be listed.
Localinstall Command
dnf [options] localinstall <spec>...
Deprecated alias for the Install Command.
Makecache Command
dnf [options] makecache
Downloads and caches metadata for all known repos. Tries to avoid downloading
whenever possible (e.g. when the local metadata hasn’t expired yet or when the
metadata timestamp hasn’t changed).
dnf [options] makecache --timer
Like plain makecache, but instructs DNF to be more resource-aware, meaning it will
not do anything if running on battery power and will terminate immediately if it’s
too soon after the last successful makecache run (see dnf.conf(5),
metadata_timer_sync).
Mark Command
dnf mark install <package-spec>...
Marks the specified packages as installed by user. This can be useful if any
package was installed as a dependency and is desired to stay on the system when
Auto Remove Command or Remove Command along with clean_requirements_on_remove
configuration option set to True is executed.
dnf mark remove <package-spec>...
Unmarks the specified packages as installed by user. Whenever you as a user don’t
need a specific package you can mark it for removal. The package stays installed on
the system but will be removed when Auto Remove Command or Remove Command along
with clean_requirements_on_remove configuration option set to True is executed. You
should use this operation instead of Remove Command if you’re not sure whether the
package is a requirement of other user installed packages on the system.
dnf mark group <package-spec>...
Marks the specified packages as installed by group. This can be useful if any
package was installed as a dependency or a user and is desired to be protected and
handled as a group member like during group remove.
Module Command
Modularity overview is available at man page dnf.modularity(7). Module subcommands
take <module-spec>… arguments that specify modules or profiles.
The <provide-spec> is matched with all file provides of any available package:
This command by default does not force a sync of expired metadata. See also
Metadata Synchronization.
Reinstall Command
dnf [options] reinstall <package-spec>...
Installs the specified packages, fails if some of the packages are either not
installed or not available (i.e. there is no repository where to download the same
RPM).
Remove Command
dnf [options] remove <package-spec>...
Removes the specified packages from the system along with any packages depending on
the packages being removed. Each <spec> can be either a <package-spec>, which
specifies a package directly, or a @<group-spec>, which specifies an (environment)
group which contains it. If clean_requirements_on_remove is enabled (the default),
also removes any dependencies that are no longer needed.
dnf [options] remove --duplicates
Removes older versions of duplicate packages. To ensure the integrity of the system
it reinstalls the newest package. In some cases the command cannot resolve
conflicts. In such cases the dnf shell command with remove --duplicates and upgrade
dnf-shell sub-commands could help.
dnf [options] remove --oldinstallonly
Removes old installonly packages, keeping only latest versions and version of
running kernel.
There are also a few specific remove commands remove-n, remove-na and remove-nevra
that allow the specification of an exact argument in the NEVRA format.
Remove Examples
dnf remove acpi tito
Remove the acpi and tito packages.
dnf remove $(dnf repoquery --extras --exclude=tito,acpi)
Remove packages not present in any repository, but don’t remove the tito and acpi
packages (they still might be removed if they depend on some of the removed
packages).
Remove older versions of duplicated packages (an equivalent of yum’s package-
cleanup –cleandups):
Repoquery Command
dnf [options] repoquery [<select-options>] [<query-options>] [<package-file-spec>]
Searches available DNF repositories for selected packages and displays the
requested information about them. It is an equivalent of rpm -q for remote
repositories.
dnf [options] repoquery --querytags
Provides the list of tags recognized by the --queryformat repoquery option.
There are also a few specific repoquery commands repoquery-n, repoquery-na and
repoquery-nevra that allow the specification of an exact argument in the NEVRA
format (does not affect arguments of options like –whatprovides <arg>, …).
Select Options
Together with <package-file-spec>, control what packages are displayed in the
output. If <package-file-spec> is given, limits the resulting set of packages to
those matching the specification. All packages are considered if no <package-file-
spec> is specified.
<package-file-spec>
Package specification in the NEVRA format (name[-[epoch:]version[-release]]
[.arch]), a package provide or a file provide. See Specifying Packages.
-a, --all
Query all packages (for rpmquery compatibility, also a shorthand for repoquery ‘*’
or repoquery without arguments).
--arch <arch>[,<arch>...], --archlist <arch>[,<arch>...]
Limit the resulting set only to packages of selected architectures (default is all
architectures). In some cases the result is affected by the basearch of the running
system, therefore to run repoquery for an arch incompatible with your system use
the --forcearch=<arch> option to change the basearch.
--duplicates
Limit the resulting set to installed duplicate packages (i.e. more package versions
for the same name and architecture). Installonly packages are excluded from this
set.
--unneeded
Limit the resulting set to leaves packages that were installed as dependencies so
they are no longer needed. This switch lists packages that are going to be removed
after executing the dnf autoremove command.
--available
Limit the resulting set to available packages only (set by default).
--disable-modular-filtering
Disables filtering of modular packages, so that packages of inactive module streams
are included in the result.
--extras
Limit the resulting set to packages that are not present in any of the available
repositories.
-f <file>, --file <file>
Limit the resulting set only to the package that owns <file>.
--installed
Limit the resulting set to installed packages only. The exclude option in the
configuration file might influence the result, but if the command line option
--disableexcludes is used, it ensures that all installed packages will be listed.
--installonly
Limit the resulting set to installed installonly packages.
--latest-limit <number>
Limit the resulting set to <number> of latest packages for every package name and
architecture. If <number> is negative, skip <number> of latest packages. For a
negative <number> use the --latest-limit=<number> syntax.
--recent
Limit the resulting set to packages that were recently edited.
--repo <repoid>
Limit the resulting set only to packages from a repository identified by <repoid>.
Can be used multiple times with accumulative effect.
--unsatisfied
Report unsatisfied dependencies among installed packages (i.e. missing requires and
and existing conflicts).
--upgrades
Limit the resulting set to packages that provide an upgrade for some already
installed package.
--userinstalled
Limit the resulting set to packages installed by the user. The exclude option in
the configuration file might influence the result, but if the command line option
--disableexcludes is used, it ensures that all installed packages will be listed.
--whatdepends <capability>[,<capability>...]
Limit the resulting set only to packages that require, enhance, recommend, suggest
or supplement any of <capabilities>.
--whatconflicts <capability>[,<capability>...]
Limit the resulting set only to packages that conflict with any of <capabilities>.
--whatenhances <capability>[,<capability>...]
Limit the resulting set only to packages that enhance any of <capabilities>. Use
--whatdepends if you want to list all depending packages.
--whatobsoletes <capability>[,<capability>...]
Limit the resulting set only to packages that obsolete any of <capabilities>.
--whatprovides <capability>[,<capability>...]
Limit the resulting set only to packages that provide any of <capabilities>.
--whatrecommends <capability>[,<capability>...]
Limit the resulting set only to packages that recommend any of <capabilities>. Use
--whatdepends if you want to list all depending packages.
--whatrequires <capability>[,<capability>...]
Limit the resulting set only to packages that require any of <capabilities>. Use
--whatdepends if you want to list all depending packages.
--whatsuggests <capability>[,<capability>...]
Limit the resulting set only to packages that suggest any of <capabilities>. Use
--whatdepends if you want to list all depending packages.
--whatsupplements <capability>[,<capability>...]
Limit the resulting set only to packages that supplement any of <capabilities>. Use
--whatdepends if you want to list all depending packages.
--alldeps
This option is stackable with --whatrequires or --whatdepends only. Additionally it
adds all packages requiring the package features to the result set (used as
default).
--exactdeps
This option is stackable with --whatrequires or --whatdepends only. Limit the
resulting set only to packages that require <capability> specified by –
whatrequires.
--srpm
Operate on the corresponding source RPM.
Query Options
Set what information is displayed about each package.
The following are mutually exclusive, i.e. at most one can be specified. If no
query option is given, matching packages are displayed in the standard NEVRA
notation.
-i, --info
Show detailed information about the package.
-l, --list
Show the list of files in the package.
-s, --source
Show the package source RPM name.
--changelogs
Print the package changelogs.
--conflicts
Display capabilities that the package conflicts with. Same as --qf "%{conflicts}.
--depends
Display capabilities that the package depends on, enhances, recommends, suggests or
supplements.
--enhances
Display capabilities enhanced by the package. Same as --qf "%{enhances}"".
--location
Show a location where the package could be downloaded from.
--obsoletes
Display capabilities that the package obsoletes. Same as --qf "%{obsoletes}".
--provides
Display capabilities provided by the package. Same as --qf "%{provides}".
--recommends
Display capabilities recommended by the package. Same as --qf "%{recommends}".
--requires
Display capabilities that the package depends on. Same as --qf "%{requires}".
--requires-pre
Display capabilities that the package depends on for running a %pre script. Same as
--qf "%{requires-pre}".
--suggests
Display capabilities suggested by the package. Same as --qf "%{suggests}".
--supplements
Display capabilities supplemented by the package. Same as --qf "%{supplements}".
--tree
Display a recursive tree of packages with capabilities specified by one of the
following supplementary options: --whatrequires, --requires, --conflicts,
--enhances, --suggests, --provides, --supplements, --recommends.
--deplist
Produce a list of all direct dependencies and what packages provide those
dependencies for the given packages. The result only shows the newest providers
(which can be changed by using –verbose).
--nvr
Show found packages in the name-version-release format. Same as --qf "%{name}-%
{version}-%{release}".
--nevra
Show found packages in the name-epoch:version-release.architecture format. Same as
--qf "%{name}-%{epoch}:%{version}-%{release}.%{arch}" (default).
--envra
Show found packages in the epoch:name-version-release.architecture format. Same as
--qf "%{epoch}:%{name}-%{version}-%{release}.%{arch}"
--qf <format>, --queryformat <format>
Custom display format. <format> is the string to output for each matched package.
Every occurrence of %{<tag>} within is replaced by the corresponding attribute of
the package. The list of recognized tags can be displayed by running dnf repoquery
--querytags.
--recursive
Query packages recursively. Has to be used with --whatrequires <REQ> (optionally
with --alldeps, but not with --exactdeps) or with --requires <REQ> --resolve.
--resolve
resolve capabilities to originating package(s).
Examples
Display NEVRAs of all available packages matching light*:
The info subcommand lists description and summary information about packages
depending on the packages’ relation to the repository. The list subcommand just
prints lists of those packages.
Shell Command
dnf [options] shell [filename]
Open an interactive shell for conducting multiple commands during a single
execution of DNF. These commands can be issued manually or passed to DNF from a
file. The commands are much the same as the normal DNF command line options. There
are a few additional commands documented below.
Swap Command
dnf [options] swap <remove-spec> <install-spec>
Remove spec and install spec in one transaction. Each <spec> can be either a
<package-spec>, which specifies a package directly, or a @<group-spec>, which
specifies an (environment) group which contains it. Automatic conflict solving is
provided in DNF by the –allowerasing option that provides the functionality of the
swap command automatically.
Update Command
dnf [options] update
Deprecated alias for the Upgrade Command.
Updateinfo Command
dnf [options] updateinfo [--summary|--list|--info] [<availability>] [<spec>...]
Display information about update advisories.
Depending on the output type, DNF displays just counts of advisory types (omitted
or --summary), list of advisories (--list) or detailed information (--info). When
the -v option is used with --info, the information is even more detailed.
Note, that --available tooks only the latest installed versions of packages into
account. In case of the kernel packages (when multiple version could be installed
simultaneously) also packages of the currently running version of kernel are added.
If given and if neither ID, type (bugfix, enhancement, security/sec) nor a package
name of an advisory matches <spec>, the advisory is not taken into account. The
matching is case-sensitive and in the case of advisory IDs and package names,
globbing is supported.
Upgrade-Minimal Command
dnf [options] upgrade-minimal
Updates each package to the latest available version that provides a bugfix,
enhancement or a fix for a security issue (security).
dnf [options] upgrade-minimal <package-spec>...
Updates each specified package to the latest available version that provides a
bugfix, enhancement or a fix for security issue (security). Updates dependencies as
necessary.
Update-To Command
dnf [options] update-to <package-nevr-specs>...
Deprecated alias for the Upgrade Command.
Upgrade-To Command
dnf [options] upgrade-to <package-nevr-specs>...
Deprecated alias for the Upgrade Command.
Specifying Packages
Many commands take a <package-spec> parameter that selects a package for the
operation. The <package-spec> argument is matched against package NEVRAs, provides
and file provides.
Globs
Package specification supports the same glob pattern matching that shell does, in
all three above mentioned packages it matches against (NEVRAs, provides and file
provides).
*
Matches any number of characters.
?
Matches any single character.
[]
Matches any one of the enclosed characters. A pair of characters separated by a
hyphen denotes a range expression; any character that falls between those two
characters, inclusive, is matched. If the first character following the [ is a ! or
a ^ then any character not enclosed is matched.
{}
Matches any of the comma separated list of enclosed strings.
NEVRA Matching
When matching against NEVRAs, partial matching is supported. DNF tries to match the
spec against the following list of NEVRA forms (in decreasing order of priority):
name-[epoch:]version-release.arch
name.arch
name
name-[epoch:]version-release
name-[epoch:]version
Note that name can in general contain dashes (e.g. package-with-dashes).
The first form that matches any packages is used and the remaining forms are not
tried. If none of the forms match any packages, an attempt is made to match the
<package-spec> against full package NEVRAs. This is only relevant if globs are
present in the <package-spec>.
<package-spec> matches NEVRAs the same way <package-name-spec> does, but in case
matching NEVRAs fails, it attempts to match against provides and file provides of
packages as well.
You can specify globs as part of any of the five NEVRA components. You can also
specify a glob pattern to match over multiple NEVRA components (in other words, to
match across the NEVRA separators). In that case, however, you need to write the
spec to match against full package NEVRAs, as it is not possible to split such spec
into NEVRA forms.
Specifying Provides
<provide-spec> in command descriptions means the command operates on packages
providing the given spec. This can either be an explicit provide, an implicit
provide (i.e. name of the package) or a file provide. The selection is case-
sensitive and globbing is supported.
Specifying Groups
<group-spec> allows one to select (environment) groups a particular operation
should work on. It is a case insensitive string (supporting globbing characters)
that is matched against a group’s ID, canonical name and name translated into the
current LC_MESSAGES locale (if possible).
Specifying Modules
<module-spec> allows one to select modules or profiles a particular operation
should work on.
NAME
NAME:STREAM
NAME:STREAM:VERSION
NAME:STREAM:VERSION:CONTEXT
all above combinations with ::ARCH (e.g. NAME::ARCH)
NAME:STREAM:VERSION:CONTEXT:ARCH
all above combinations with /PROFILE (e.g. NAME/PROFILE)
In case stream is not specified, the enabled or the default stream is used, in this
order. In case profile is not specified, the system default profile or the
‘default’ profile is used.
Specifying Transactions
<transaction-spec> can be in one of several forms. If it is an integer, it
specifies a transaction ID. Specifying last is the same as specifying the ID of the
most recent transaction. The last form is last-<offset>, where <offset> is a
positive integer. It specifies offset-th transaction preceding the most recent
transaction.
Package Filtering
Package filtering filters packages out from the available package set, making them
invisible to most of dnf commands. They cannot be used in a transaction. Packages
can be filtered out by either Exclude Filtering or Modular Filtering.
Exclude Filtering
Exclude Filtering is a mechanism used by a user or by a DNF plugin to modify the
set of available packages. Exclude Filtering can be modified by either includepkgs
or excludepkgs configuration options in configuration files. The --disableexcludes
command line option can be used to override excludes from configuration files. In
addition to user-configured excludes, plugins can also extend the set of excluded
packages. To disable excludes from a DNF plugin you can use the --disableplugin
command line option.
To disable all excludes for e.g. the install command you can use the following
combination of command line options:
Modular Filtering
Please see the modularity documentation for details on how Modular Filtering works.
With modularity, only RPM packages from active module streams are included in the
available package set. RPM packages from inactive module streams, as well as non-
modular packages with the same name or provides as a package from an active module
stream, are filtered out. Modular filtering is not applied to packages added from
the command line, installed packages, or packages from repositories with
module_hotfixes=true in their .repo file.
To discover the module which contains an excluded package use dnf module provides.
Metadata Synchronization
Correct operation of DNF depends on having access to up-to-date data from all
enabled repositories but contacting remote mirrors on every operation considerably
slows it down and costs bandwidth for both the client and the repository provider.
The metadata_expire (see dnf.conf(5)) repository configuration option is used by
DNF to determine whether a particular local copy of repository data is due to be
re-synced. It is crucial that the repository providers set the option well, namely
to a value where it is guaranteed that if particular metadata was available in time
T on the server, then all packages it references will still be available for
download from the server in time T + metadata_expire.
To further reduce the bandwidth load, some of the commands where having up-to-date
metadata is not critical (e.g. the list command) do not look at whether a
repository is expired and whenever any version of it is locally available to the
user’s account, it will be used. For non-root use, see also the --cacheonly switch.
Note that in all situations the user can force synchronization of all enabled
repositories with the --refresh switch.
Files
Cache Files
/var/cache/dnf
Main Configuration
/etc/dnf/dnf.conf
Repository
/etc/yum.repos.d/