dnf5-specs - Man Page

Patterns Specification


Different pattern matching rules for arguments in *-spec form are defined for operation with each entity type in DNF5. In this section all rules are described and explained in detail, with examples.


Pattern specification supports the same glob pattern matching that shell does. The following patterns are supported:


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.

Note: Curly brackets ({}) are not supported. You can still use them in shells that support them and let the shell do the expansion, but if quoted or escaped, DNF5 will not expand them.

Nevra Matching

Each package can be uniquely identified by the NEVRA string. It consists of 5 parts of information:

Package name.
Epoch number.
It is not always included.

The epoch number overrides other version checking, so it can be used to force the package upgrade over some other one.

Version string.
It is not strictly numeric.
It is intended to match the upstream software version.
Edition string.

It is an information about the particular package build, usually a number increased with the newer build. It is not connected with the upstream software.

Target architecture string.
Defines the processor type the package is intended to be installed on.

It can be also a package containing source files (src) or architecture-independent package (noarch).

When matching against NEVRAs, partial matching is supported. DNF5 tries to match the spec against the following list of NEVRA forms (in decreasing order of priority):


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.


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.

<package-file-spec> is similar to <package-spec>, except provides matching is not performed. Therefore, <package-file-spec> is matched only against NEVRAs and file provides.

<package-name-spec> is matched against NEVRAs only.


<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 File Provides

If a spec starts with either / or */, it is considered as a potential file provide.


<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).


<module-spec> allows one to select modules or profiles a particular operation should work on.

Since NEVRA matching form is insufficient for modules, they are uniquely identified by the NSVCA format (NAME:STREAM:VERSION:CONTEXT:ARCH/PROFILE). Supported partial forms are the following:

All above combinations with ::ARCH (e.g. NAME::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.


<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.


See AUTHORS.md in dnf5 source distribution.

Referenced By

dnf5(8), dnf5-distro-sync(8), dnf5-downgrade(8), dnf5-download(8), dnf5-environment(8), dnf5-group(8), dnf5-install(8), dnf5-mark(8), dnf5-reinstall(8), dnf5-remove(8), dnf5-repoquery(8), dnf5-upgrade(8).

Nov 02, 2022 dnf5