DNF COMMAND

Rispondi
cmo
Reactions score: 0
mag 2020 05 06:08

DNF COMMAND

Messaggio da cmo

DNF Command Reference
Synopsis

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

dnf-command(<alias>)

, where 

Codice: Seleziona tutto

<alias>

 is the name of the command; e.g.dnf install ‘dnf-command(versionlock)’ installs a 

Codice: Seleziona tutto

versionlock

 plugin. This approach also applies to specifying dependencies of packages that require a particular DNF command.
Return values:

Available commands:

Additional information:

Options

Codice: Seleziona tutto

-4

Resolve to IPv4 addresses only.

Codice: Seleziona tutto

-6

Resolve to IPv6 addresses only.

Codice: Seleziona tutto

--advisory=<advisory>, --advisories=<advisory>

Include packages corresponding to the advisory ID, Eg. FEDORA-2201-123. Applicable for the install, repoquery, updateinfo and upgrade commands.

Codice: Seleziona tutto

--allowerasing

Allow erasing of installed packages to resolve dependencies. This option could be used as an alternative to the 

Codice: Seleziona tutto

yum swap

 command where packages to remove are not explicitly defined.

Codice: Seleziona tutto

--assumeno

Automatically answer no for all questions.

Codice: Seleziona tutto

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

Codice: Seleziona tutto

--bugfix

Include packages that fix a bugfix issue. Applicable for the install, repoquery, updateinfo and upgrade commands.

Codice: Seleziona tutto

--bz=<bugzilla>, --bzs=<bugzilla>

Include packages that fix a Bugzilla ID, Eg. 123123. Applicable for the install, repoquery, updateinfo and upgrade commands.

Codice: Seleziona tutto

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

Codice: Seleziona tutto

--color=<color>

Control whether color is used in terminal output. Valid values are 

Codice: Seleziona tutto

always

Codice: Seleziona tutto

never

 and 

Codice: Seleziona tutto

auto

 (default).

Codice: Seleziona tutto

--comment=<comment>

Add a comment to the transaction history.

Codice: Seleziona tutto

-c <config file>, --config=<config file>

Configuration file location.

Codice: Seleziona tutto

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

Codice: Seleziona tutto

-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 

Codice: Seleziona tutto

-v

 instead.

Codice: Seleziona tutto

--debugsolver

Dump data aiding in dependency solver debugging into 

Codice: Seleziona tutto

./debugdata

.

Codice: Seleziona tutto

--disableexcludes=[all|main|<repoid>], --disableexcludepkgs=[all|main|<repoid>]

Disable the configuration file excludes. Takes one of the following three options:

Codice: Seleziona tutto

--disable, --set-disabled

Disable specified repositories (automatically saves). The option has to be used together with the 

Codice: Seleziona tutto

config-manager

 command (dnf-plugins-core).

Codice: Seleziona tutto

--disableplugin=<plugin names>

Disable the listed plugins specified by names or globs.

Codice: Seleziona tutto

--disablerepo=<repoid>

Disable specific repositories by an id or a glob. This option is mutually exclusive with 

Codice: Seleziona tutto

--repo

.

Codice: Seleziona tutto

--downloaddir=<path>, --destdir=<path>

Redirect downloaded packages to provided directory. The option has to be used together with the --downloadonly command line option, with the 

Codice: Seleziona tutto

download

 command (dnf-plugins-core) or with the 

Codice: Seleziona tutto

system-upgrade

 command (dnf-plugins-extras).

Codice: Seleziona tutto

--downloadonly

Download the resolved package set without performing any rpm transaction (install/upgrade/erase).

Codice: Seleziona tutto

-e <error level>, --errorlevel=<error level>

Error output level. This is an integer value between 0 (no error output) and 10 (shows all error messages), default is 3. Deprecated, use 

Codice: Seleziona tutto

-v

 instead.

Codice: Seleziona tutto

--enable, --set-enabled

Enable specified repositories (automatically saves). The option has to be used together with the 

Codice: Seleziona tutto

config-manager

 command (dnf-plugins-core).

Codice: Seleziona tutto

--enableplugin=<plugin names>

Enable the listed plugins specified by names or globs.

Codice: Seleziona tutto

--enablerepo=<repoid>

Enable additional repositories by an id or a glob.

Codice: Seleziona tutto

--enhancement

Include enhancement relevant packages. Applicable for the install, repoquery, updateinfo and upgrade commands.

Codice: Seleziona tutto

-x <package-file-spec>, --exclude=<package-file-spec>

Exclude packages specified by 

Codice: Seleziona tutto

<package-file-spec>

 from the operation.

Codice: Seleziona tutto

--excludepkgs=<package-file-spec>

Deprecated option. It was replaced by the --exclude option.

Codice: Seleziona tutto

--forcearch=<arch>

Force the use of an architecture. Any architecture can be specified. However, use of an architecture not supported natively by your CPU will require emulation of some kind. This is usually through QEMU. The behavior of 

Codice: Seleziona tutto

--forcearch

 can be configured by using the arch and ignorearch configuration options with values 

Codice: Seleziona tutto

<arch>

 and 

Codice: Seleziona tutto

True

 respectively.

Codice: Seleziona tutto

-h, --help, --help-cmd

Show the help.

Codice: Seleziona tutto

--installroot=<path>

Specifies an alternative installroot, relative to where all packages will be installed. Think of this like doing 

Codice: Seleziona tutto

chroot <root> dnf

, except using 

Codice: Seleziona tutto

--installroot

 allows dnf to work before the chroot is created. It requires absolute path.

  • cachedirlog filesreleasever, and gpgkey are taken from or stored in the installroot. Gpgkeys are imported into the installroot from a path relative to the host which can be specified in the repository section of configuration files.

  • configuration file and reposdir are searched inside the installroot first. If they are not present, they are taken from the host system. Note: When a path is specified within a command line argument (

    Codice: Seleziona tutto

    --config=<config file>

     in case of configuration file and 

    Codice: Seleziona tutto

    --setopt=reposdir=<reposdir>

     for reposdir) then this path is always relative to the host with no exceptions.

  • vars are taken from the host system or installroot according to reposdir . When reposdir path is specified within a command line argument, vars are taken from the installroot. When varsdir paths are specified within a command line argument (

    Codice: Seleziona tutto

    --setopt=varsdir=<reposdir>

    ) then those path are always relative to the host with no exceptions.

  • The pluginpath and pluginconfpath are relative to the host.

Note: You may also want to use the command-line option 

Codice: Seleziona tutto

--releasever=<release>

 when creating the installroot, otherwise the $releasever value is taken from the rpmdb within the installroot (and thus it is empty at the time of creation and the transaction will fail). If 

Codice: Seleziona tutto

--releasever=/

 is used, the releasever will be detected from the host (

) system. The new installroot path at the time of creation does not contain the repositoryreleasever and dnf.conf files.
On a modular system you may also want to use the 

Codice: Seleziona tutto

--setopt=module_platform_id=<module_platform_name:stream>

 command-line option when creating the installroot, otherwise the module_platform_id value will be taken from the 

Codice: Seleziona tutto

/etc/os-release

 file within the installroot (and thus it will be empty at the time of creation, the modular dependency could be unsatisfied and modules content could be excluded).
Installroot examples:

Codice: Seleziona tutto

dnf --installroot=<installroot> --releasever=<release> install system-release

Permanently sets the 

Codice: Seleziona tutto

releasever

 of the system in the 

Codice: Seleziona tutto

<installroot>

 directory to 

Codice: Seleziona tutto

<release>

.

Codice: Seleziona tutto

dnf --installroot=<installroot> --setopt=reposdir=<path> --config /path/dnf.conf upgrade

Upgrades packages inside the installroot from a repository described by 

Codice: Seleziona tutto

--setopt

 using configuration from 

Codice: Seleziona tutto

/path/dnf.conf

.

Codice: Seleziona tutto

--newpackage

Include newpackage relevant packages. Applicable for the install, repoquery, updateinfo and upgrade commands.

Codice: Seleziona tutto

--noautoremove

Disable removal of dependencies that are no longer used. It sets clean_requirements_on_remove configuration option to 

Codice: Seleziona tutto

False

.

Codice: Seleziona tutto

--nobest

Set best option to 

Codice: Seleziona tutto

False

, so that transactions are not limited to best candidates only.

Codice: Seleziona tutto

--nodocs

Do not install documentation. Sets the rpm flag ‘RPMTRANS_FLAG_NODOCS’.

Codice: Seleziona tutto

--nogpgcheck

Skip checking GPG signatures on packages (if RPM policy allows).

Codice: Seleziona tutto

--noplugins

Disable all plugins.

Codice: Seleziona tutto

--obsoletes


This option has an effect on an install/update, it enables dnf’s obsoletes processing logic. For more information see the obsoletes option.

This option also displays capabilities that the package obsoletes when used together with the repoquery command.

Configuration Option: obsoletes

Codice: Seleziona tutto

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

Codice: Seleziona tutto

-R <minutes>, --randomwait=<minutes>

Maximum command wait time.

Codice: Seleziona tutto

--refresh

Set metadata as expired before running the command.

Codice: Seleziona tutto

--releasever=<release>

Configure DNF as if the distribution release was 

Codice: Seleziona tutto

<release>

. This can affect cache paths, values in configuration files and mirrorlist URLs.

Codice: Seleziona tutto

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

    Codice: Seleziona tutto

    <repo>

    .

  • The path or url to the repository is specified by 

    Codice: Seleziona tutto

    <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 

    Codice: Seleziona tutto

    --repo=<repo>

     or 

    Codice: Seleziona tutto

    --disablerepo="*"

     switches.

Codice: Seleziona tutto

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

Codice: Seleziona tutto

--disablerepo="*" --enablerepo=<repoid>

 and is mutually exclusive with the 

Codice: Seleziona tutto

--disablerepo

 option.

Codice: Seleziona tutto

--rpmverbosity=<name>

RPM debug scriptlet output level. Sets the debug level to 

Codice: Seleziona tutto

<name>

 for RPM scriptlets. For available levels, see the 

Codice: Seleziona tutto

rpmverbosity

 configuration option.

Codice: Seleziona tutto

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

Codice: Seleziona tutto

--security

Includes packages that provide a fix for a security issue. Applicable for the upgrade command.

Codice: Seleziona tutto

--setopt=<option>=<value>

Override a configuration option from the configuration file. To override configuration options for repositories, use 

Codice: Seleziona tutto

repoid.option

 for the 

Codice: Seleziona tutto

<option>

. Values for configuration options like 

Codice: Seleziona tutto

excludepkgs

Codice: Seleziona tutto

includepkgs

Codice: Seleziona tutto

installonlypkgs

 and 

Codice: Seleziona tutto

tsflags

 are appended to the original value, they do not override it. However, specifying an empty value (e.g. 

Codice: Seleziona tutto

--setopt=tsflags=

) will clear the option.

Codice: Seleziona tutto

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

Codice: Seleziona tutto

False

. Additionally, with the enable and disable module subcommands it allows one to perform an action even in case of broken modular dependencies.

Codice: Seleziona tutto

--showduplicates

Show duplicate packages in repositories. Applicable for the list and search commands.

Codice: Seleziona tutto

-v, --verbose

Verbose operation, show debug messages.

Codice: Seleziona tutto

--version

Show DNF version and exit.

Codice: Seleziona tutto

-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 

Codice: Seleziona tutto

<package-spec>

 and 

Codice: Seleziona tutto

<package-file-spec>

 see Specifying Packages.
For an explanation of 

Codice: Seleziona tutto

<package-nevr-spec>

 see Specifying Exact Versions of Packages.
For an explanation of 

Codice: Seleziona tutto

<provide-spec>

 see Specifying Provides.
For an explanation of 

Codice: Seleziona tutto

<group-spec>

 see Specifying Groups.
For an explanation of 

Codice: Seleziona tutto

<module-spec>

 see Specifying Modules.
For an explanation of 

Codice: Seleziona tutto

<transaction-spec>

 see Specifying Transactions.
Alias Command
Allows the user to define and manage a list of aliases (in the form 

Codice: Seleziona tutto

<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.
In case the processing would result in an infinite recursion, the original arguments are used instead.
Also, like in shell aliases, if the result starts with a 

, the alias processing will stop.
All aliases are defined in configuration files in the 

Codice: Seleziona tutto

/etc/dnf/aliases.d/

 directory in the [aliases] section, and aliases created by the alias command are written to the 

Codice: Seleziona tutto

USER.conf

 file. In case of conflicts, the 

Codice: Seleziona tutto

USER.conf

 has the highest priority, and alphabetical ordering is used for the rest of the configuration files.
Optionally, there is the 

Codice: Seleziona tutto

enabled

 option in the 

Codice: Seleziona tutto

[main]

 section defaulting to True. This can be set for each file separately in the respective file, or globally for all aliases in the 

Codice: Seleziona tutto

ALIASES.conf

 file.

Codice: Seleziona tutto

dnf alias [options] [list] [<name>...]

List aliases with their final result. The 

Codice: Seleziona tutto

[<alias>...]

 parameter further limits the result to only those aliases matching it.

Codice: Seleziona tutto

dnf alias [options] add <name=value>...

Create new aliases.

Codice: Seleziona tutto

dnf alias [options] delete <name>...

Delete aliases.

Alias Examples

Codice: Seleziona tutto

dnf alias list

Lists all defined aliases.

Codice: Seleziona tutto

dnf alias add rm=remove

Adds a new command alias called 

Codice: Seleziona tutto

rm

 which works the same as the 

Codice: Seleziona tutto

remove

 command.

Codice: Seleziona tutto

dnf alias add upgrade="\upgrade --skip-broken --disableexcludes=all --obsoletes"

Adds a new command alias called 

Codice: Seleziona tutto

upgrade

 which works the same as the 

Codice: Seleziona tutto

upgrade

 command, with additional options. Note that the original 

Codice: Seleziona tutto

upgrade

 command is prefixed with a 

 to prevent an infinite loop in alias processing.
Alias Processing Examples
If there are defined aliases 

Codice: Seleziona tutto

in=install

 and 

Codice: Seleziona tutto

FORCE="--skip-broken --disableexcludes=all"

:

If there is defined alias 

Codice: Seleziona tutto

in=install

:

Auto Remove Command

Codice: Seleziona tutto

dnf [options] autoremove

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.

Codice: Seleziona tutto

dnf [options] autoremove <spec>...

This is an alias for the Remove Command command with clean_requirements_on_remove set to 

Codice: Seleziona tutto

True

. It removes the specified packages from the system along with any packages depending on the packages being removed. Each 

Codice: Seleziona tutto

<spec>

 can be either a 

Codice: Seleziona tutto

<package-spec>

, which specifies a package directly, or a 

Codice: Seleziona tutto

@<group-spec>

, which specifies an (environment) group which contains it. It also removes any dependencies that are no longer needed.
There are also a few specific autoremove commands 

Codice: Seleziona tutto

autoremove-n


Codice: Seleziona tutto

autoremove-na

 and 

Codice: Seleziona tutto

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

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

--dependencies


Codice: Seleziona tutto

--duplicates


Codice: Seleziona tutto

--obsoleted

 and 

Codice: Seleziona tutto

--provides

 options (the default is to check everything).

Check-Update Command

Codice: Seleziona tutto

dnf [options] check-update [--changelogs] [<package-file-spec>...]

Non-interactively checks if updates of the specified packages are available. If no 

Codice: Seleziona tutto

<package-file-spec>

 is given, checks whether any updates at all are available for your system. DNF exit code will be 100 when there are updates available and a list of the updates will be printed, 0 if not and 1 if an error occurs. If 

Codice: Seleziona tutto

--changelogs

 option is specified, also changelog delta of packages about to be updated is printed.
Please note that having a specific newer version available for an installed package (and reported by 

Codice: Seleziona tutto

check-update

) does not imply that subsequent 

Codice: Seleziona tutto

dnf upgrade

 will install it. The difference is that 

Codice: Seleziona tutto

dnf upgrade

 has restrictions (like package dependencies being satisfied) to take into account.
The output is affected by the autocheck_running_kernel configuration option.

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.

Codice: Seleziona tutto

dnf clean dbcache

Removes cache files generated from the repository metadata. This forces DNF to regenerate the cache files the next time it is run.

Codice: Seleziona tutto

dnf clean expire-cache

Marks the repository metadata expired. DNF will re-validate the cache for each repository the next time it is used.

Codice: Seleziona tutto

dnf clean metadata

Removes repository metadata. Those are the files which DNF uses to determine the remote availability of packages. Using this option will make DNF download all the metadata the next time it is run.

Codice: Seleziona tutto

dnf clean packages

Removes any cached packages from the system.

Codice: Seleziona tutto

dnf clean all

Does all of the above.
Deplist command

Codice: Seleziona tutto

dnf [options] deplist [<select-options>] [<query-options>] [<package-spec>]

Alias for dnf repoquery –deplist.
Distro-Sync command

Codice: Seleziona tutto

dnf distro-sync [<package-spec>...]


As necessary upgrades, downgrades or keeps selected installed packages to match the latest version available from any enabled repository. If no package is given, all installed packages are considered.

See also Configuration Files Replacement Policy.

Distribution-Synchronization command

Codice: Seleziona tutto

dnf distribution-synchronization

Deprecated alias for the Distro-Sync command.
Downgrade Command

Codice: Seleziona tutto

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

Codice: Seleziona tutto

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.

Codice: Seleziona tutto

dnf [options] group [summary] <group-spec>

Display overview of how many groups are installed and available. With a spec, limit the output to the matching groups. 

Codice: Seleziona tutto

summary

 is the default groups subcommand.

Codice: Seleziona tutto

dnf [options] group info <group-spec>

Display package lists of a group. Shows which packages are installed or available from a repository when 

Codice: Seleziona tutto

-v

 is used.

Codice: Seleziona tutto

dnf [options] group install [--with-optional] <group-spec>...

Mark the specified group installed and install packages it contains. Also include optional packages of the group if 

Codice: Seleziona tutto

--with-optional

 is specified. All mandatory and Default packages will be installed whenever possible. Conditional packages are installed if they meet their requirement. If the group is already (partially) installed, the command installs the missing packages from the group. Depending on the value of obsoletes configuration option group installation takes obsoletes into account.

Codice: Seleziona tutto

dnf [options] group list <group-spec>...

List all matching groups, either among installed or available groups. If nothing is specified, list all known groups. 

Codice: Seleziona tutto

--installed

 and 

Codice: Seleziona tutto

--available

 options narrow down the requested list. Records are ordered by the display_order tag defined in comps.xml file. Provides a list of all hidden groups by using option 

Codice: Seleziona tutto

--hidden

. Provides group IDs when the 

Codice: Seleziona tutto

-v

 or 

Codice: Seleziona tutto

--ids

 options are used.

Codice: Seleziona tutto

dnf [options] group remove <group-spec>...

Mark the group removed and remove those packages in the group from the system which do not belong to another installed group and were not installed explicitly by the user.

Codice: Seleziona tutto

dnf [options] group upgrade <group-spec>...

Upgrades the packages from the group and upgrades the group itself. The latter comprises of installing packages that were added to the group by the distribution and removing packages that got removed from the group as far as they were not installed explicitly by the user.
Groups can also be marked installed or removed without physically manipulating any packages:

Codice: Seleziona tutto

dnf [options] group mark install <group-spec>...

Mark the specified group installed. No packages will be installed by this command, but the group is then considered installed.

Codice: Seleziona tutto

dnf [options] group mark remove <group-spec>...

Mark the specified group removed. No packages will be removed by this command.
See also Configuration Files Replacement Policy.
Groups Command

Codice: Seleziona tutto

dnf [options] groups

Deprecated alias for the Group Command.
Help Command

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

history_record

 configuration option is set).

Codice: Seleziona tutto

dnf history [list] [<spec>...]

The default history action is listing information about given transactions in a table. Each 

Codice: Seleziona tutto

<spec>

 can be either a 

Codice: Seleziona tutto

<transaction-spec>

, which specifies a transaction directly, or a 

Codice: Seleziona tutto

<transaction-spec>..<transaction-spec>

, which specifies a range of transactions, or a 

Codice: Seleziona tutto

<package-name-spec>

, which specifies a transaction by a package which it manipulated. When no transaction is specified, list all known transactions.

Codice: Seleziona tutto

dnf history info [<spec>...]

Describe the given transactions. The meaning of 

Codice: Seleziona tutto

<spec>

 is the same as in the History List Command. When no transaction is specified, describe what happened during the latest transaction.

Codice: Seleziona tutto

dnf history redo <transaction-spec>|<package-file-spec>

Repeat the specified transaction. Uses the last transaction (with the highest ID) if more than one transaction for given <package-file-spec> is found. If it is not possible to redo some operations due to the current state of RPMDB, it will not redo the transaction.

Codice: Seleziona tutto

dnf history rollback <transaction-spec>|<package-file-spec>

Undo all transactions performed after the specified transaction. Uses the last transaction (with the highest ID) if more than one transaction for given <package-file-spec> is found. If it is not possible to undo some transactions due to the current state of RPMDB, it will not undo any transaction.

Codice: Seleziona tutto

dnf history undo <transaction-spec>|<package-file-spec>

Perform the opposite operation to all operations performed in the specified transaction. Uses the last transaction (with the highest ID) if more than one transaction for given <package-file-spec> is found. If it is not possible to undo some operations due to the current state of RPMDB, it will not undo the transaction.

Codice: Seleziona tutto

dnf history userinstalled

Show all installonly packages, packages installed outside of DNF and packages not installed as dependency. I.e. it lists packages that will stay on the system when Auto Remove Command or Remove Command along with clean_requirements_on_remove configuration option set to True is executed. Note the same results can be accomplished with 

Codice: Seleziona tutto

dnf repoquery --userinstalled

, and the repoquery command is more powerful in formatting of the output.
This command by default does not force a sync of expired metadata, except for the redo, rollback, and undo subcommands. See also Metadata Synchronization and Configuration Files Replacement Policy.
Info Command

Codice: Seleziona tutto

dnf [options] info [<package-file-spec>...]

Lists description and summary information about installed and available packages.
The info command limits the displayed packages the same way as the list command.
This command by default does not force a sync of expired metadata. See also Metadata Synchronization.
Install Command

Codice: Seleziona tutto

dnf [options] install <spec>...


Makes sure that the given packages and their dependencies are installed on the system. Each 

Codice: Seleziona tutto

<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 

Codice: Seleziona tutto

<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 

Codice: Seleziona tutto

install-n

Codice: Seleziona tutto

install-na

 and 

Codice: Seleziona tutto

install-nevra

 that allow the specification of an exact argument in the NEVRA format.

See also Configuration Files Replacement Policy.

Install Examples

Codice: Seleziona tutto

dnf install tito

Install the 

Codice: Seleziona tutto

tito

 package (tito is the package name).

Codice: Seleziona tutto

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.

Codice: Seleziona tutto

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.

Codice: Seleziona tutto

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.

Codice: Seleziona tutto

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.

Codice: Seleziona tutto

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.

Codice: Seleziona tutto

dnf install '@docker'

Install all default profiles of module ‘docker’ and their RPMs. Module streams get enabled accordingly.

Codice: Seleziona tutto

dnf install '@Web Server'

Install the ‘Web Server’ environmental group.

Codice: Seleziona tutto

dnf install /usr/bin/rpmsign

Install a package that provides the /usr/bin/rpmsign file.

Codice: Seleziona tutto

dnf -y install tito --setopt=install_weak_deps=False

Install the 

Codice: Seleziona tutto

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

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

installed

 if it is present in the RPMDB, and it is 

Codice: Seleziona tutto

available

 if it is not installed but is present in a repository that DNF knows about.
The list command also limits the displayed packages according to specific criteria, e.g. to only those that update an installed package (respecting the repository priority). 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.

Codice: Seleziona tutto

dnf [options] list [--all] [<package-file-spec>...]

Lists all packages, present in the RPMDB, in a repository or both.

Codice: Seleziona tutto

dnf [options] list --installed [<package-file-spec>...]

Lists installed packages.

Codice: Seleziona tutto

dnf [options] list --available [<package-file-spec>...]

Lists available packages.

Codice: Seleziona tutto

dnf [options] list --extras [<package-file-spec>...]

Lists extras, that is packages installed on the system that are not available in any known repository.

Codice: Seleziona tutto

dnf [options] list --obsoletes [<package-file-spec>...]

List packages installed on the system that are obsoleted by packages in any known repository.

Codice: Seleziona tutto

dnf [options] list --recent [<package-file-spec>...]

List packages recently added into the repositories.

Codice: Seleziona tutto

dnf [options] list --upgrades [<package-file-spec>...]

List upgrades available for the installed packages.

Codice: Seleziona tutto

dnf [options] list --autoremove

List packages which will be removed by the 

Codice: Seleziona tutto

dnf autoremove

 command.
This command by default does not force a sync of expired metadata. See also Metadata Synchronization.
Localinstall Command

Codice: Seleziona tutto

dnf [options] localinstall <spec>...

Deprecated alias for the Install Command.
Makecache Command

Codice: Seleziona tutto

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

Codice: Seleziona tutto

dnf [options] makecache --timer

Like plain 

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

makecache

 run (see dnf.conf(5)metadata_timer_sync).
Mark Command

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

True

 is executed.

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

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.

Codice: Seleziona tutto

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.

Codice: Seleziona tutto

dnf [options] module install <module-spec>...


Install module profiles, including their packages. In case no profile was provided, all default profiles get installed. Module streams get enabled accordingly.

This command cannot be used for switching module streams. It is recommended to remove all installed content from the module and reset the module using the reset command. After you reset the module, you can install the other stream.

Codice: Seleziona tutto

dnf [options] module update <module-spec>...

Update packages associated with an active module stream, optionally restricted to a profile. If the profile_name is provided, only the packages referenced by that profile will be updated.

Codice: Seleziona tutto

dnf [options] module remove <module-spec>...

Remove installed module profiles, including packages that were installed with the dnf module install command. Will not remove packages required by other installed module profiles or by other user-installed packages. In case no profile was provided, all installed profiles get removed.

Codice: Seleziona tutto

dnf [options] module remove --all <module-spec>...

Remove installed module profiles, including packages that were installed with the dnf module install command. With –all option it additionally removes all packages whose names are provided by specified modules. Packages required by other installed module profiles and packages whose names are also provided by any other module are not removed.

Codice: Seleziona tutto

dnf [options] module enable <module-spec>...


Enable a module stream and make the stream RPMs available in the package set.

Modular dependencies are resolved, dependencies checked and also recursively enabled. In case of modular dependency issue the operation will be rejected. To perform the action anyway please use --skip-broken option.

This command cannot be used for switching module streams. It is recommended to remove all installed content from the module, and reset the module using the reset command. After you reset the module, you can enable the other stream.

Codice: Seleziona tutto

dnf [options] module disable <module-name>...

Disable a module. All related module streams will become unavailable. Consequently, all installed profiles will be removed and the module RPMs will become unavailable in the package set. In case of modular dependency issue the operation will be rejected. To perform the action anyway please use --skip-broken option.

Codice: Seleziona tutto

dnf [options] module reset <module-name>...

Reset module state so it’s no longer enabled or disabled. Consequently, all installed profiles will be removed and only RPMs from the default stream will be available in the package set.

Codice: Seleziona tutto

dnf [options] module provides <package-name-spec>...

Lists all modular packages matching 

Codice: Seleziona tutto

<package-name-spec>

 from all modules (including disabled), along with the modules and streams they belong to.

Codice: Seleziona tutto

dnf [options] module list [--all] [module_name...]

Lists all module streams, their profiles and states (enabled, disabled, default).

Codice: Seleziona tutto

dnf [options] module list --enabled [module_name...]

Lists module streams that are enabled.

Codice: Seleziona tutto

dnf [options] module list --disabled [module_name...]

Lists module streams that are disabled.

Codice: Seleziona tutto

dnf [options] module list --installed [module_name...]

List module streams with installed profiles.

Codice: Seleziona tutto

dnf [options] module info <module-spec>...

Print detailed information about given module stream.

Codice: Seleziona tutto

dnf [options] module info --profile <module-spec>...

Print detailed information about given module profiles.

Codice: Seleziona tutto

dnf [options] module repoquery <module-spec>...

List all available packages belonging to selected modules.

Codice: Seleziona tutto

dnf [options] module repoquery --available <module-spec>...

List all available packages belonging to selected modules.

Codice: Seleziona tutto

dnf [options] module repoquery --installed <module-spec>...

List all installed packages with same name like packages belonging to selected modules.
Provides Command

Codice: Seleziona tutto

dnf [options] provides <provide-spec>


Finds the packages providing the given 

Codice: Seleziona tutto

<provide-spec>

. This is useful when one knows a filename and wants to find what package (installed or not) provides this file. The 

Codice: Seleziona tutto

<provide-spec>

 is gradually looked for at following locations:

  1. The 

    Codice: Seleziona tutto

    <provide-spec>

     is matched with all file provides of any available package:
    $ dnf provides /usr/bin/gzip
    gzip-1.9-9.fc29.x86_64 : The GNU data compression program
    Matched from:
    Filename    : /usr/bin/gzip

  2. Then all provides of all available packages are searched:
    $ dnf provides "gzip(x86-64)"
    gzip-1.9-9.fc29.x86_64 : The GNU data compression program
    Matched from:
    Provide    : gzip(x86-64) = 1.9-9.fc29

  3. DNF assumes that the 

    Codice: Seleziona tutto

    <provide-spec>

     is a system command, prepends it with 

    Codice: Seleziona tutto

    /usr/bin/


    Codice: Seleziona tutto

    /usr/sbin/

     prefixes (one at a time) and does the file provides search again. For legacy reasons (packages that didn’t do UsrMove) also 

    Codice: Seleziona tutto

    /bin

     and 

    Codice: Seleziona tutto

    /sbin

     prefixes are being searched:
    $ dnf provides zless
    gzip-1.9-9.fc29.x86_64 : The GNU data compression program
    Matched from:
    Filename    : /usr/bin/zless

  4. If this last step also fails, DNF returns “Error: No Matches found”.


This command by default does not force a sync of expired metadata. See also Metadata Synchronization.

Reinstall Command

Codice: Seleziona tutto

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

Codice: Seleziona tutto

dnf [options] remove <package-spec>...

Removes the specified packages from the system along with any packages depending on the packages being removed. Each 

Codice: Seleziona tutto

<spec>

 can be either a 

Codice: Seleziona tutto

<package-spec>

, which specifies a package directly, or a 

Codice: Seleziona tutto

@<group-spec>

, which specifies an (environment) group which contains it. If 

Codice: Seleziona tutto

clean_requirements_on_remove

 is enabled (the default), also removes any dependencies that are no longer needed.

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

remove --duplicates

 and 

Codice: Seleziona tutto

upgrade

 dnf-shell sub-commands could help.

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

remove-n

Codice: Seleziona tutto

remove-na

 and 

Codice: Seleziona tutto

remove-nevra

 that allow the specification of an exact argument in the NEVRA format.

Remove Examples

Codice: Seleziona tutto

dnf remove acpi tito

Remove the 

Codice: Seleziona tutto

acpi

 and 

Codice: Seleziona tutto

tito

 packages.

Codice: Seleziona tutto

dnf remove $(dnf repoquery --extras --exclude=tito,acpi)

Remove packages not present in any repository, but don’t remove the 

Codice: Seleziona tutto

tito

 and 

Codice: Seleziona tutto

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):
dnf remove --duplicates

Repoinfo Command

An alias for the repolist command that provides more detailed information like 

Codice: Seleziona tutto

dnf repolist -v

.

Repolist Command

Codice: Seleziona tutto

dnf [options] repolist [--enabled|--disabled|--all]

Depending on the exact command lists enabled, disabled or all known repositories. Lists all enabled repositories by default. Provides more detailed information when 

Codice: Seleziona tutto

-v

 option is used.
This command by default does not force a sync of expired metadata. See also Metadata Synchronization.
Repoquery Command

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

rpm -q

 for remote repositories.

Codice: Seleziona tutto

dnf [options] repoquery --querytags


Provides the list of tags recognized by the --queryformat repoquery option.

There are also a few specific repoquery commands 

Codice: Seleziona tutto

repoquery-n

Codice: Seleziona tutto

repoquery-na

 and 

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

<package-file-spec>

, control what packages are displayed in the output. If 

Codice: Seleziona tutto

<package-file-spec>

 is given, limits the resulting set of packages to those matching the specification. All packages are considered if no 

Codice: Seleziona tutto

<package-file-spec>

 is specified.

Codice: Seleziona tutto

<package-file-spec>

Package specification in the NEVRA format (name[-[epoch:]version[-release]][.arch]), a package provide or a file provide. See Specifying Packages.

Codice: Seleziona tutto

-a

Codice: Seleziona tutto

--all

Query all packages (for rpmquery compatibility, also a shorthand for repoquery ‘*’ or repoquery without arguments).

Codice: Seleziona tutto

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

Codice: Seleziona tutto

--forcearch=<arch>

 option to change the basearch.

Codice: Seleziona tutto

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

Codice: Seleziona tutto

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

Codice: Seleziona tutto

dnf autoremove

 command.

Codice: Seleziona tutto

--available

Limit the resulting set to available packages only (set by default).

Codice: Seleziona tutto

--disable-modular-filtering

Disables filtering of modular packages, so that packages of inactive module streams are included in the result.

Codice: Seleziona tutto

--extras

Limit the resulting set to packages that are not present in any of the available repositories.

Codice: Seleziona tutto

-f <file>

Codice: Seleziona tutto

--file <file>

Limit the resulting set only to the package that owns 

Codice: Seleziona tutto

<file>

.

Codice: Seleziona tutto

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

Codice: Seleziona tutto

--installonly

Limit the resulting set to installed installonly packages.

Codice: Seleziona tutto

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

Codice: Seleziona tutto

--latest-limit=<number>

 syntax.

Codice: Seleziona tutto

--recent

Limit the resulting set to packages that were recently edited.

Codice: Seleziona tutto

--repo <repoid>

Limit the resulting set only to packages from a repository identified by 

Codice: Seleziona tutto

<repoid>

. Can be used multiple times with accumulative effect.

Codice: Seleziona tutto

--unsatisfied

Report unsatisfied dependencies among installed packages (i.e. missing requires and and existing conflicts).

Codice: Seleziona tutto

--upgrades

Limit the resulting set to packages that provide an upgrade for some already installed package.

Codice: Seleziona tutto

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

Codice: Seleziona tutto

--whatdepends <capability>[,<capability>...]

Limit the resulting set only to packages that require, enhance, recommend, suggest or supplement any of 

Codice: Seleziona tutto

<capabilities>

.

Codice: Seleziona tutto

--whatconflicts <capability>[,<capability>...]

Limit the resulting set only to packages that conflict with any of 

Codice: Seleziona tutto

<capabilities>

.

Codice: Seleziona tutto

--whatenhances <capability>[,<capability>...]

Limit the resulting set only to packages that enhance any of 

Codice: Seleziona tutto

<capabilities>

. Use --whatdepends if you want to list all depending packages.

Codice: Seleziona tutto

--whatobsoletes <capability>[,<capability>...]

Limit the resulting set only to packages that obsolete any of 

Codice: Seleziona tutto

<capabilities>

.

Codice: Seleziona tutto

--whatprovides <capability>[,<capability>...]

Limit the resulting set only to packages that provide any of 

Codice: Seleziona tutto

<capabilities>

.

Codice: Seleziona tutto

--whatrecommends <capability>[,<capability>...]

Limit the resulting set only to packages that recommend any of 

Codice: Seleziona tutto

<capabilities>

. Use --whatdepends if you want to list all depending packages.

Codice: Seleziona tutto

--whatrequires <capability>[,<capability>...]

Limit the resulting set only to packages that require any of 

Codice: Seleziona tutto

<capabilities>

. Use --whatdepends if you want to list all depending packages.

Codice: Seleziona tutto

--whatsuggests <capability>[,<capability>...]

Limit the resulting set only to packages that suggest any of 

Codice: Seleziona tutto

<capabilities>

. Use --whatdepends if you want to list all depending packages.

Codice: Seleziona tutto

--whatsupplements <capability>[,<capability>...]

Limit the resulting set only to packages that supplement any of 

Codice: Seleziona tutto

<capabilities>

. Use --whatdepends if you want to list all depending packages.

Codice: Seleziona tutto

--alldeps

This option is stackable with 

Codice: Seleziona tutto

--whatrequires

 or --whatdepends only. Additionally it adds all packages requiring the package features to the result set (used as default).

Codice: Seleziona tutto

--exactdeps

This option is stackable with 

Codice: Seleziona tutto

--whatrequires

 or --whatdepends only. Limit the resulting set only to packages that require 

Codice: Seleziona tutto

<capability>

 specified by –whatrequires.

Codice: Seleziona tutto

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

Codice: Seleziona tutto

-i, --info

Show detailed information about the package.

Codice: Seleziona tutto

-l, --list

Show the list of files in the package.

Codice: Seleziona tutto

-s, --source

Show the package source RPM name.

Codice: Seleziona tutto

--changelogs

Print the package changelogs.

Codice: Seleziona tutto

--conflicts

Display capabilities that the package conflicts with. Same as 

Codice: Seleziona tutto

--qf "%{conflicts}

.

Codice: Seleziona tutto

--depends

Display capabilities that the package depends on, enhances, recommends, suggests or supplements.

Codice: Seleziona tutto

--enhances

Display capabilities enhanced by the package. Same as 

Codice: Seleziona tutto

--qf "%{enhances}""

.

Codice: Seleziona tutto

--location

Show a location where the package could be downloaded from.

Codice: Seleziona tutto

--obsoletes

Display capabilities that the package obsoletes. Same as 

Codice: Seleziona tutto

--qf "%{obsoletes}"

.

Codice: Seleziona tutto

--provides

Display capabilities provided by the package. Same as 

Codice: Seleziona tutto

--qf "%{provides}"

.

Codice: Seleziona tutto

--recommends

Display capabilities recommended by the package. Same as 

Codice: Seleziona tutto

--qf "%{recommends}"

.

Codice: Seleziona tutto

--requires

Display capabilities that the package depends on. Same as 

Codice: Seleziona tutto

--qf "%{requires}"

.

Codice: Seleziona tutto

--requires-pre

Display capabilities that the package depends on for running a 

Codice: Seleziona tutto

%pre

 script. Same as 

Codice: Seleziona tutto

--qf "%{requires-pre}"

.

Codice: Seleziona tutto

--suggests

Display capabilities suggested by the package. Same as 

Codice: Seleziona tutto

--qf "%{suggests}"

.

Codice: Seleziona tutto

--supplements

Display capabilities supplemented by the package. Same as 

Codice: Seleziona tutto

--qf "%{supplements}"

.

Codice: Seleziona tutto

--tree

Display a recursive tree of packages with capabilities specified by one of the following supplementary options: 

Codice: Seleziona tutto

--whatrequires

Codice: Seleziona tutto

--requires

Codice: Seleziona tutto

--conflicts

Codice: Seleziona tutto

--enhances

Codice: Seleziona tutto

--suggests

Codice: Seleziona tutto

--provides

Codice: Seleziona tutto

--supplements

Codice: Seleziona tutto

--recommends

.

Codice: Seleziona tutto

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

Codice: Seleziona tutto

--nvr

Show found packages in the name-version-release format. Same as 

Codice: Seleziona tutto

--qf "%{name}-%{version}-%{release}"

.

Codice: Seleziona tutto

--nevra

Show found packages in the name-epoch:version-release.architecture format. Same as 

Codice: Seleziona tutto

--qf "%{name}-%{epoch}:%{version}-%{release}.%{arch}"

 (default).

Codice: Seleziona tutto

--envra

Show found packages in the epoch:name-version-release.architecture format. Same as 

Codice: Seleziona tutto

--qf "%{epoch}:%{name}-%{version}-%{release}.%{arch}"

Codice: Seleziona tutto

--qf <format>

Codice: Seleziona tutto

--queryformat <format>

Custom display format. 

Codice: Seleziona tutto

<format>

 is the string to output for each matched package. Every occurrence of 

Codice: Seleziona tutto

%{<tag>}

 within is replaced by the corresponding attribute of the package. The list of recognized tags can be displayed by running 

Codice: Seleziona tutto

dnf repoquery --querytags

.

Codice: Seleziona tutto

--recursive

Query packages recursively. Has to be used with 

Codice: Seleziona tutto

--whatrequires <REQ>

 (optionally with 

Codice: Seleziona tutto

--alldeps

, but not with 

Codice: Seleziona tutto

--exactdeps

) or with 

Codice: Seleziona tutto

--requires <REQ> --resolve

.

Codice: Seleziona tutto

--resolve

resolve capabilities to originating package(s).
Examples
Display NEVRAs of all available packages matching 

Codice: Seleziona tutto

light*

:
dnf repoquery 'light*'

Display NEVRAs of all available packages matching name 

Codice: Seleziona tutto

light*

 and architecture 

Codice: Seleziona tutto

noarch

 (accepts only arguments in the “<name>.<arch>” format):
dnf repoquery-na 'light*.noarch'

Display requires of all lighttpd packages:
dnf repoquery --requires lighttpd

Display packages providing the requires of python packages:
dnf repoquery --requires python --resolve

Display source rpm of ligttpd package:
dnf repoquery --source lighttpd

Display package name that owns the given file:
dnf repoquery --file /etc/lighttpd/lighttpd.conf

Display name, architecture and the containing repository of all lighttpd packages:
dnf repoquery --queryformat '%{name}.%{arch} : %{reponame}' lighttpd

Display all available packages providing “webserver”:
dnf repoquery --whatprovides webserver

Display all available packages providing “webserver” but only for “i686” architecture:
dnf repoquery --whatprovides webserver --arch i686

Display duplicate packages:
dnf repoquery --duplicates

Display source packages that require a <provide> for a build:
dnf repoquery --disablerepo="" --enablerepo="-source" --arch=src --whatrequires <provide>

Repo-Pkgs Command

Codice: Seleziona tutto

dnf [options] repo-pkgs

Deprecated alias for the Repository-Packages Command.
Repository-Packages Command
The repository-packages command allows the user to run commands on top of all packages in the repository named 

Codice: Seleziona tutto

<repoid>

. However, any dependency resolution takes into account packages from all enabled repositories. The 

Codice: Seleziona tutto

<package-file-spec>

 and 

Codice: Seleziona tutto

<package-spec>

 specifications further limit the candidates to only those packages matching at least one of them.
The 

Codice: Seleziona tutto

info

 subcommand lists description and summary information about packages depending on the packages’ relation to the repository. The 

Codice: Seleziona tutto

list

 subcommand just prints lists of those packages.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> check-update [<package-file-spec>...]

Non-interactively checks if updates of the specified packages in the repository are available. DNF exit code will be 100 when there are updates available and a list of the updates will be printed.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> info [--all] [<package-file-spec>...]

List all related packages.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> info --installed [<package-file-spec>...]

List packages installed from the repository.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> info --available [<package-file-spec>...]

List packages available in the repository but not currently installed on the system.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> info --extras [<package-file-specs>...]

List packages installed from the repository that are not available in any repository.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> info --obsoletes [<package-file-spec>...]

List packages in the repository that obsolete packages installed on the system.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> info --recent [<package-file-spec>...]

List packages recently added into the repository.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> info --upgrades [<package-file-spec>...]

List packages in the repository that upgrade packages installed on the system.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> install [<package-spec>...]

Install all packages in the repository.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> list [--all] [<package-file-spec>...]

List all related packages.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> list --installed [<package-file-spec>...]

List packages installed from the repository.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> list --available [<package-file-spec>...]

List packages available in the repository but not currently installed on the system.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> list --extras [<package-file-spec>...]

List packages installed from the repository that are not available in any repository.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> list --obsoletes [<package-file-spec>...]

List packages in the repository that obsolete packages installed on the system.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> list --recent [<package-file-spec>...]

List packages recently added into the repository.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> list --upgrades [<package-file-spec>...]

List packages in the repository that upgrade packages installed on the system.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> move-to [<package-spec>...]

Reinstall all those packages that are available in the repository.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> reinstall [<package-spec>...]

Run the 

Codice: Seleziona tutto

reinstall-old

 subcommand. If it fails, run the 

Codice: Seleziona tutto

move-to

 subcommand.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> reinstall-old [<package-spec>...]

Reinstall all those packages that were installed from the repository and simultaneously are available in the repository.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> remove [<package-spec>...]

Remove all packages installed from the repository along with any packages depending on the packages being removed. If 

Codice: Seleziona tutto

clean_requirements_on_remove

 is enabled (the default) also removes any dependencies that are no longer needed.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> remove-or-distro-sync [<package-spec>...]

Select all packages installed from the repository. Upgrade, downgrade or keep those of them that are available in another repository to match the latest version available there and remove the others along with any packages depending on the packages being removed. If 

Codice: Seleziona tutto

clean_requirements_on_remove

 is enabled (the default) also removes any dependencies that are no longer needed.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> remove-or-reinstall [<package-spec>...]

Select all packages installed from the repository. Reinstall those of them that are available in another repository and remove the others along with any packages depending on the packages being removed. If 

Codice: Seleziona tutto

clean_requirements_on_remove

 is enabled (the default) also removes any dependencies that are no longer needed.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> upgrade [<package-spec>...]

Update all packages to the highest resolvable version available in the repository.

Codice: Seleziona tutto

dnf [options] repository-packages <repoid> upgrade-to <package-nevr-specs>...

Update packages to the specified versions that are available in the repository. Upgrade-to is a deprecated alias for the upgrade subcommand.
Search Command

Codice: Seleziona tutto

dnf [options] search [--all] <keywords>...

Search package metadata for keywords. Keywords are matched as case-insensitive substrings, globbing is supported. By default lists packages that match all requested keys (AND operation). Keys are searched in package names and summaries. If the “–all” option is used, lists packages that match at least one of the keys (an OR operation). In addition the keys are searched in the package descriptions and URLs. The result is sorted from the most relevant results to the least.
This command by default does not force a sync of expired metadata. See also Metadata Synchronization.
Shell Command

Codice: Seleziona tutto

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.

Codice: Seleziona tutto

config [conf-option] [value]
  • Set a configuration option to a requested value. If no value is given it prints the current value.

Codice: Seleziona tutto

repo [list|enable|disable] [repo-id]
  • list: list repositories and their status

  • enable: enable repository

  • disable: disable repository

Codice: Seleziona tutto

transaction [list|reset|solve|run]
  • list: resolve and list the content of the transaction

  • reset: reset the transaction

  • run: resolve and run the transaction


Note that all local packages must be used in the first shell transaction subcommand (e.g. install /tmp/nodejs-1-1.x86_64.rpm /tmp/acpi-1-1.noarch.rpm) otherwise an error will occur. Any disable, enable, and reset module operations (e.g. module enable nodejs) must also be performed before any other shell transaction subcommand is used.

Swap Command

Codice: Seleziona tutto

dnf [options] swap <remove-spec> <install-spec>

Remove spec and install spec in one transaction. Each 

Codice: Seleziona tutto

<spec>

 can be either a <package-spec>, which specifies a package directly, or a 

Codice: Seleziona tutto

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

Codice: Seleziona tutto

dnf [options] update

Deprecated alias for the Upgrade Command.
Updateinfo Command

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

--summary

), list of advisories (

Codice: Seleziona tutto

--list

) or detailed information (

Codice: Seleziona tutto

--info

). The 

Codice: Seleziona tutto

-v

 option extends the output. When used with 

Codice: Seleziona tutto

--info

, the information is even more detailed. When used with 

Codice: Seleziona tutto

--list

, an additional column with date of the last advisory update is added.

Codice: Seleziona tutto

<availability>

 specifies whether advisories about newer versions of installed packages (omitted or 

Codice: Seleziona tutto

--available

), advisories about equal and older versions of installed packages (

Codice: Seleziona tutto

--installed

), advisories about newer versions of those installed packages for which a newer version is available (

Codice: Seleziona tutto

--updates

) or advisories about any versions of installed packages (

Codice: Seleziona tutto

--all

) are taken into account. Most of the time, 

Codice: Seleziona tutto

--available

 and 

Codice: Seleziona tutto

--updates

 displays the same output. The outputs differ only in the cases when an advisory refers to a newer version but there is no enabled repository which contains any newer version.

Note, that 

Codice: Seleziona tutto

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

To print only advisories referencing a CVE or a bugzilla use 

Codice: Seleziona tutto

--with-cve

 or 

Codice: Seleziona tutto

--with-bz

 options. When these switches are used also the output of the 

Codice: Seleziona tutto

--list

 is altered - the ID of the CVE or the bugzilla is printed instead of the one of the advisory.

If given and if neither ID, type (

Codice: Seleziona tutto

bugfix

Codice: Seleziona tutto

enhancement

Codice: Seleziona tutto

security

/

Codice: Seleziona tutto

sec

) nor a package name of an advisory matches 

Codice: Seleziona tutto

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

Output of the 

Codice: Seleziona tutto

--summary

 option is affected by the autocheck_running_kernel configuration option.

Update-Minimal Command

Codice: Seleziona tutto

dnf [options] update-minimal

Deprecated alias for the Upgrade-Minimal Command.
Upgrade Command

Codice: Seleziona tutto

dnf [options] upgrade

Updates each package to the latest version that is both available and resolvable.

Codice: Seleziona tutto

dnf [options] upgrade <package-spec>...

Updates each specified package to the latest available version. Updates dependencies as necessary.

Codice: Seleziona tutto

dnf [options] upgrade <package-nevr-specs>...

Upgrades packages to the specified versions.

Codice: Seleziona tutto

dnf [options] upgrade @<spec>...

Alias for the dnf module update command.
If the main 

Codice: Seleziona tutto

obsoletes

 configure option is true or the 

Codice: Seleziona tutto

--obsoletes

 flag is present, dnf will include package obsoletes in its calculations. For more information see obsoletes.
See also Configuration Files Replacement Policy.
Upgrade-Minimal Command

Codice: Seleziona tutto

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

Codice: Seleziona tutto

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

Codice: Seleziona tutto

dnf [options] update-to <package-nevr-specs>...

Deprecated alias for the Upgrade Command.
Upgrade-To Command

Codice: Seleziona tutto

dnf [options] upgrade-to <package-nevr-specs>...

Deprecated alias for the Upgrade Command.
Specifying Packages
Many commands take a 

Codice: Seleziona tutto

<package-spec>

 parameter that selects a package for the operation. The 

Codice: Seleziona tutto

<package-spec>

 argument is matched against package NEVRAs, provides and file provides.

Codice: Seleziona tutto

<package-file-spec>

 is similar to 

Codice: Seleziona tutto

<package-spec>

, except provides matching is not performed. Therefore, 

Codice: Seleziona tutto

<package-file-spec>

 is matched only against NEVRAs and file provides.

Codice: Seleziona tutto

<package-name-spec>

 is matched against NEVRAs only.
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).
The following patterns are supported:

Matches any number of characters.

Matches any single character.

Codice: Seleziona tutto

[]

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.

Codice: Seleziona tutto

{}

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

Note that 

Codice: Seleziona tutto

name

 can in general contain dashes (e.g. 

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

<package-spec>

 against full package NEVRAs. This is only relevant if globs are present in the 

Codice: Seleziona tutto

<package-spec>

.

Codice: Seleziona tutto

<package-spec>

 matches NEVRAs the same way 

Codice: Seleziona tutto

<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 Exact Versions of Packages
Commands accepting the 

Codice: Seleziona tutto

<package-nevr-spec>

 parameter need not only the name of the package, but also its version, release and optionally the architecture. Further, the version part can be preceded by an epoch when it is relevant (i.e. the epoch is non-zero).
Specifying Provides

Codice: Seleziona tutto

<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

Codice: Seleziona tutto

<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

Codice: Seleziona tutto

<module-spec>

 allows one to select modules or profiles a particular operation should work on.
It is in the form of 

Codice: Seleziona tutto

NAME:STREAM:VERSION:CONTEXT:ARCH/PROFILE

 and supported partial forms are the following:

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

Codice: Seleziona tutto

<transaction-spec>

 can be in one of several forms. If it is an integer, it specifies a transaction ID. Specifying 

Codice: Seleziona tutto

last

 is the same as specifying the ID of the most recent transaction. The last form is 

Codice: Seleziona tutto

last-<offset>

, where 

Codice: Seleziona tutto

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

Codice: Seleziona tutto

dnf --disableexcludes=all --disableplugin="*" install bash

Modular Filtering
Please see the modularity documentation for details on how Modular Filtering works.
With modularity, only RPM packages from 

Codice: Seleziona tutto

active

 module streams are included in the available package set. RPM packages from 

Codice: Seleziona tutto

inactive

 module streams, as well as non-modular packages with the same name or provides as a package from an 

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

module_hotfixes=true

 in their 

Codice: Seleziona tutto

.repo

 file.
Disabling of modular filtering is not recommended, because it could cause the system to get into a broken state. To disable modular filtering for a particular repository, specify 

Codice: Seleziona tutto

module_hotfixes=true

 in the 

Codice: Seleziona tutto

.repo

 file or use 

Codice: Seleziona tutto

--setopt=<repo_id>.module_hotfixes=true

.
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 

 on the server, then all packages it references will still be available for download from the server in time 

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

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 

Codice: Seleziona tutto

--cacheonly

 switch. Note that in all situations the user can force synchronization of all enabled repositories with the 

Codice: Seleziona tutto

--refresh

 switch.
Configuration Files Replacement Policy
The updated packages could replace the old modified configuration files with the new ones or keep the older files. Neither of the files are actually replaced. To the conflicting ones RPM gives additional suffix to the origin name. Which file should maintain the true name after transaction is not controlled by package manager but is specified by each package itself, following packaging guideline.

Files

Codice: Seleziona tutto

Cache Files

/var/cache/dnf

Codice: Seleziona tutto

Main Configuration

/etc/dnf/dnf.conf

Codice: Seleziona tutto

Repository

/etc/yum.repos.d/

Rispondi