dnf(8) - DNF Command Reference
-
DNF(8) DNF DNF(8) NAME dnf - DNF Command Reference SYNOPSIS dnf [options] <command> [<args>...] DESCRIPTION DNF is the next upcoming major version of YUM, a package manager for RPM-based Linux distribu‐ tions. 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 spec‐ ifying dependencies of packages that require a particular DNF command. Return values: · 0 : Operation was successful. · 1 : An error occurred, which was handled by dnf. · 3 : An unknown unhandled error occurred during operation. · 100: See check-update · 200: There was a problem with acquiring or releasing of locks. Available commands: · alias · autoremove · check · check-update · clean · 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> Includes packages corresponding to the advisory ID, Eg. FEDORA-2201-123. Applicable for install, repoquery, updateinfo, and upgrade command. --allowerasing Allow erasing of installed packages to resolve dependencies. This option could be used as an alternative to 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 Includes packages that fix a bugfix issue. Applicable for install, repoquery, update‐ info, and upgrade command. --bz=<bugzilla> Includes packages that fix a Bugzilla ID, Eg. 123123. Applicable for install, repoquery, updateinfo, and upgrade command. -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. --comment=<comment> add a comment to transaction history -c <config file>, --config=<config file> config file location --cve=<cves> Includes packages that fix a CVE (Common Vulnerabilities and Exposures) ID (‐ http://cve.mitre.org/about/), Eg. CVE-2201-0123. Applicable for install, repoquery, updateinfo, and upgrade command. -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>] Disable the config file excludes. Takes one of three options: · all, disables all config file excludes · main, disables excludes defined in the [main] section · repoid, disables excludes defined for the given repo --disable, --set-disabled Disable specified repositories (automatically saves). The option has to be used together with config-manager command (dnf-plugins-core). --disableplugin=<plugin names> Disable the listed plugins specified by names or globs. --disablerepo=<repoid> Disable specific repositories by an id or a glob. This option is mutually exclusive with --repo. --downloaddir=<path> Redirect downloaded packages to provided directory. The option has to by used together with --downloadonly command line option or with download command (dnf-plugins-core) or with system-upgrade command (dnf-plugins-extras). --downloadonly Download resolved package set without performing any rpm transaction (install/upgrade/erase). -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 -v instead. --enable, --set-enabled Enable specified repositories (automatically saves). The option has to be used together with config-manager command (dnf-plugins-core). --enableplugin=<plugin names> Enable the listed plugins specified by names or globs. --enablerepo=<repoid> Enable additional repositories by an id or a glob. --enhancement Include enhancement relevant packages. Applicable for install, repoquery, updateinfo, and upgrade command. -x <package-spec>, --exclude=<package-spec> Exclude packages specified by <package-spec> from the operation. --excludepkgs=<package-spec> Deprecated option. It was replaced by --exclude option. --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 --forcearch could be emulate using config‐ uration option arch with <arch> and ignorearch with True. -h, --help Show the help. --installroot=<path> Specifies an alternative installroot, relative to where all packages will be installed. Think of this like doing chroot <root> dnf except using --installroot allows dnf to work before the chroot is created. · cachedir, log files, releasever, and gpgkey are taken from or stored in installroot. Gpgkeys are imported into installroot from path, related to the host, described in .repo file. · config file and reposdir are searched inside the installroot first. If they are not present, they are taken from host system. Note: When a path is specified within command line argu‐ ment (--config=<config file> in case of config file and --setopt=reposdir=<reposdir> for reposdir) then this path is always related to the host with no exceptions. · The pluginpath and pluginconfpath are not related to installroot. Note: You may also want to use the command-line option --releasever=<release> when creating the installroot otherwise the $releasever value is taken from the rpmdb within the install‐ root (and thus it is empty at time of creation, the transaction will fail). If --relea‐ sever=/ is used, the releasever will be detected from host (/) system. The new installroot path at time of creation does not contain repository, releasever, and dnf.conf file. On modular system you may also want to use the command-line option --setopt=module_plat‐ form_id=<module_platform_name:stream> when creating the installroot otherwise the mod‐ ule_platform_id value is taken from the /etc/os-release within the installroot (and thus it is empty at time of creation, the modular dependency could be unsatisfied and modules con‐ tent could be excluded). Installroot examples: dnf --installroot=<installroot> --releasever=<release> install system-release Sets permanently the releasever of the system within <installroot> directory from given <release>. dnf --installroot=<installroot> --setopt=reposdir=<path> --config /path/dnf.conf upgrade Upgrade packages inside of installroot from repository described by --setopt using configuration from /path/dnf.conf --newpackage Include newpackage relevant packages. Applicable for install, repoquery, updateinfo, and upgrade command. --noautoremove disable removal of dependencies that are no longer used. It sets clean_require‐ ments_on_remove conf option to False. --nobest Set best option as false, therefore transactions are not limited to only best candi‐ dates. --nodocs do not install documentation by using rpm flag 'RPMTRANS_FLAG_NODOCS' --nogpgcheck skip checking GPG signatures on packages (if RPM policy allows) --noplugins Disable all plugins. --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 affects the repoquery command, it displays capabilities that the pack‐ age obsoletes. Configuration Option: obsoletes -q, --quiet In combination with a non-interactive command it shows just the relevant content. It suppresses messages notifying about 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 path or url to a repository (same path as in a baseurl) to add to the reposi‐ tories for this query. This option can be used multiple times. The repo label for the repository is specified by <repo>. If you want to view only the packages from this repository, combine this with with --repo=<repo> or --disablerepo="*" switches. The repo label for the repository is specified by <repo>. --repo=<repoid> Enable just specific repositories by an id or a glob. Can be used multiple times with accumulative effect. It is basically shortcut for --disablerepo="*" --enablerepo=<repoid> and is mutually exclusive with --disablerepo option. --rpmverbosity=<name> RPM debug scriptlet output level. Sets the debug level to <name> for RPM scriptlets. For available levels, see rpmverbosity configuration option. --sec-severity=<severity>, --secseverity=<severity> Includes packages that provides a fix for issue of the specified severity. Applicable for install, repoquery, updateinfo, and upgrade command. --security Includes packages that provides a fix for security issue. Applicable for upgrade com‐ mand. --setopt=<option>=<value> override a config option from the config file. To override config options from repo files, use repoid.option for the <option>. Conf options like excludepkgs, includepkgs, installonlypkgs, and tsflags work as append option, therefore they are not overridden but the value is appended. If there is no value like --setopt=tsflags= it remove all values in append options. --skip-broken Resolve depsolve problems by removing packages that are causing problems from the trans‐ action. It is alias for configuration option strict with False value. Additionally with module subcommands enable and disable it allow to perform action even in case of broken modular dependencies. --showduplicates show duplicates, in repos, in list/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 con‐ figuration files. COMMANDS For an explanation of <package-spec> and <package-name-spec> see Specifying Packages. For an explanation of <package-nevr-spec> see Specifying Exact Versions of Packages. For an explanation of <provide-spec> see Specifying Provides. For an explanation of <group-spec> see Specifying Groups. For an explanation of <module-spec> see Specifying Modules. For an explanation of <transaction-spec> see Specifying Transactions. Alias Command 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 process‐ ing, 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 \ then alias processing will stop. All aliases are defined in configuration files in directory /etc/dnf/aliases.d/ in the [aliases] section, and aliases created by the alias command are located in the file USER.conf. Optionally, there is a section [main] with option enabled defaulting to True. This can be set for each file separately in the respective file, or globaly for all aliases in the file ALIASES.conf. dnf alias [options] [list] [<name>...] 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>... Create new aliases. dnf alias [options] delete <name>... Delete aliases. Alias Examples dnf alias list Lists all defined aliases. dnf alias add rm=remove Adds new alias command called "rm" which does the same thing as the command "remove". dnf alias add update="\update --skip-broken --disableexcludes=all --obsoletes" Adds new alias command called "update" which does the same thing as the command "update", but with options --skip-broken --disableexcludes=all --obsoletes. Alias Processing Examples If there are defined aliases in=install and FORCE="--skip-broken --disableexcludes=all": · dnf FORCE in will be replaced with dnf --skip-broken --disableexcludes=all install · dnf in FORCE will be replaced with dnf install FORCE (which will fail) If there is defined alias in=install: · dnf in will be replaced with dnf install · dnf --repo updates in will be replaced with dnf --repo updates in (which will fail) Auto Remove Command 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. dnf [options] autoremove <spec>... This is an alias for Remove Command command with clean_requirements_on_remove set to True. It 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 pack‐ age directly, or a @<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 autoremove-n, autoremove-na and autore‐ move-nevra that allow the specification of an exact argument in NEVRA (name-epoch:ver‐ sion-release.architecture) format. This command by default does not force a sync of expired metadata. See also Metadata Synchro‐ nization. Check Command dnf [options] check [--dependencies] [--duplicates] [--obsoleted] [--provides] Checks the local packagedb and produces information on any problems it finds. You can pass the check command the options "--dependencies", "--duplicates", "--obsoleted" or "--pro‐ vides", to limit the checking that is performed (the default is "all" which does all). Check Update Command dnf [options] check-update [--changelogs] [<package-specs>...] Non-interactively checks if updates of the specified packages are available. If no <pack‐ age-specs> are 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 --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 check-update) does not imply that subsequent dnf upgrade will install it. The difference is that dnf upgrade must also ensure the satisfiability of all dependencies and other restrictions. Output is affected by config option autocheck_running_kernel 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 ver‐ sions. dnf clean dbcache Removes cache files generated from the repository metadata. This forces DNF to regener‐ ate the cache files the next time it is run. dnf clean expire-cache Marks the repository metadata expired. DNF will re-validate the cache for each repo the next time it is used. 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. dnf clean packages Removes any cached packages from the system. dnf clean all Does all of the above. Distro-sync command dnf distro-sync [<package-spec>...] As necessary upgrades, downgrades or keeps selected installed packages to match the lat‐ est 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 dnf distribution-synchronization Deprecated alias for the Distro-sync command. Downgrade Command dnf [options] downgrade <package-installed-specs>... 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 pack‐ age 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. 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. summary is the default groups subcommand. dnf [options] group info <group-spec> Display package lists of a group. Shows which packages are installed or available from a repo when -v is used. 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 --with-optional is specified. All mandatory and Default packages will be installed whenever possible. Conditional packages are installed if they meet their requirement. If group is already (partially) installed, command installs missing packages from the group. dnf [options] group list <group-spec>... List all matching groups, either among installed or available groups. If nothing is specified list all known groups. Options --installed and --available narrows down the requested list. Records are ordered by display_order tag defined in comps.xml file. Provides a list of all hidden groups by using option --hidden. Provides more detailed information when -v option is used. dnf [options] group remove <group-spec>... Mark the group removed and remove those packages in the group from the system which are neither comprising another installed group and were not installed explicitly by the user. 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: 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. 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. Help Command dnf help [<command>] Displays the help text for all commands. If given a command name then only displays the 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). dnf history [list] [<spec>...] The default history action is listing information about given transactions in a table. Each <spec> can be either a <transaction-spec>, which specifies a transaction directly, or a <transaction-spec>..<transaction-spec>, which specifies a range of transactions, or a <package-name-spec>, which specifies a transaction by a package which it manipulated. When no transaction is specified, list all known transactions. dnf history info [<spec>...] Describe the given transactions. The meaning of <spec> is the same as in the History List Command. When no transaction is specified, describe what happened during the latest transaction. dnf history redo <transaction-spec>|<package-name-spec> Repeat the specified transaction. Uses the last transaction (with highest ID) if more than one transaction for given <package-name-spec> is found. If it is not possible to redo some operations due to the current state of RPMDB, it will not redo the transac‐ tion. dnf history rollback <transaction-spec>|<package-name-spec> Undo all transactions performed after the specified transaction. Uses the last transac‐ tion (with highest ID) if more than one transaction for given <package-name-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. dnf history undo <transaction-spec>|<package-name-spec> Perform the opposite operation to all operations performed in the specified transaction. Uses the last transaction (with highest ID) if more than one transaction for given <package-name-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. dnf history userinstalled It will 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 configura‐ tion option set to True is executed. Note the same results can be accomplished with 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, roll‐ back, and undo subcommands. See also Metadata Synchronization and Configuration Files Replace‐ ment Policy. Info Command dnf [options] info [<package-name-spec>...] Is used to list description and summary information about installed and available pack‐ ages. This command by default does not force a sync of expired metadata. See also Metadata Synchro‐ nization. Install Command dnf [options] install <spec>... DNF makes sure that the given packages and their dependencies are installed on the sys‐ tem. 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> that specify 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 NEVRA format. See also Configuration Files Replacement Policy. Install Examples dnf install tito Install package tito (tito is package name). dnf install ~/Downloads/tito-0.6.2-1.fc22.noarch.rpm Install local rpm file tito-0.6.2-1.fc22.noarch.rpm from ~/Downloads/ directory. dnf install tito-0.5.6-1.fc22 Install package with specific version. If the package is already installed it will auto‐ matically try to downgrade or upgrade to specific version. dnf --best install tito Install the latest available version of package. If the package is already installed it will automatically try to upgrade to the latest version. If the latest version of pack‐ age cannot be installed, the installation fail. dnf install vim DNF will automatically recognize that vim is not a package name, but provide, and install a package that provides vim with all required dependencies. Note: Package name match has precedence over package provides match. dnf install https://kojipkgs.fedoraproject.org//pack‐ ages/tito/0.6.0/1.fc22/noarch/tito-0.6.0-1.fc22.noarch.rpm Install package directly from URL. dnf install '@docker' Install all default profiles of module 'docker' and their RPMs. Module streams get enabled accordingly. dnf install '@Web Server' Install environmental group 'Web Server' dnf install /usr/bin/rpmsign Install a package that provides /usr/bin/rpmsign file. dnf -y install tito --setopt=install_weak_deps=False Install package tito (tito is 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, ...). dnf install --advisory=FEDORA-2018-b7b99fe852 \* Install all packages that belong to "FEDORA-2018-b7b99fe852" advisory. List Command Dumps 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 it is present in a repository that DNF knows about. The list command can also limit the displayed packages according to other criteria, e.g. to only those that update an installed package. The exclude option in configuration file (.conf) might influence the result, but if the command line option --disableexcludes is used, it ensure that all installed packages will be listed. All the forms take a [<package-specs>...] parameter to further limit the result to only those packages matching it. dnf [options] list [--all] [<package-name-specs>...] Lists all packages known to us, present in the RPMDB, in a repo or in both. dnf [options] list --installed [<package-name-specs>...] Lists installed packages. dnf [options] list --available [<package-name-specs>...] Lists available packages. dnf [options] list --extras [<package-name-specs>...] Lists extras, that is packages installed on the system that are not available in any known repository. dnf [options] list --obsoletes [<package-name-specs>...] List the packages installed on the system that are obsoleted by packages in any known repository. dnf [options] list --recent [<package-name-specs>...] List packages recently added into the repositories. dnf [options] list --upgrades [<package-name-specs>...] List upgrades available for the installed packages. dnf [options] list --autoremove List packages which will be removed by dnf autoremove command. This command by default does not force a sync of expired metadata. See also Metadata Synchro‐ nization. Makecache Command dnf [options] makecache Downloads and caches in binary format metadata for all known repos. Tries to avoid down‐ loading 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 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-specs>... 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-specs>... 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_require‐ ments_on_remove configuration option set to True is executed. You should use this opera‐ tion 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-specs>... 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 Module subcommands take <module-spec> that specify modules or profiles. dnf [options] module install <module-spec>... Install module profiles incl. their RPMs. 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 reset command. After you reset the module, you can install the other stream. dnf [options] module update <module-spec>... Update RPMs in installed module profiles. In case no profile was provided, all installed profiles get updated. dnf [options] module remove <module-spec>... Remove installed module profiles incl. their RPMs. In case no profile was provided, all installed profiles get removed. 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 action any‐ way 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 reset command. After you reset the module, you can enable the other stream. dnf [options] module disable <module-spec>... Disable a module. All related module streams will become unavailable. In case of modular dependency issue the operation will be rejected. To perform action anyway please use -‐ -skip-broken option. dnf [options] module reset <module-spec>... Reset module state so it's no longer enabled or disabled. dnf [options] module list [--all] [module_name...] Lists all module streams, their profiles and states (enabled, disabled, default) dnf [options] module list --enabled [module_name...] Lists module streams that are enabled. dnf [options] module list --disabled [module_name...] Lists module streams that are disabled. dnf [options] module list --installed [module_name...] List module streams with installed profiles. dnf [options] module info <module-spec>... Print detailed information about given module stream. dnf [options] module info --profile <module-spec>... Print detailed information about given module profiles. Provides Command dnf [options] provides <provide-spec> Finds the packages providing the given <provide-spec>. This is useful when one knows a filename and wants to find what package (installed or not) provides this file. This command by default does not force a sync of expired metadata. See also Metadata Synchro‐ nization. Reinstall Command dnf [options] reinstall <package-specs>... 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-specs>... 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 con‐ tains 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 version of duplicated packages. dnf [options] remove --oldinstallonly Removes old installonly packages keeping only installonly_limit latest versions. There are also a few specific remove commands remove-n, remove-na and remove-nevra that allow the specification of an exact argument in NEVRA format. Remove Examples dnf remove acpi tito Remove packages acpi and tito dnf remove $(dnf repoquery --extras --exclude=tito,acpi) Remove packages not present in any repository, but it doesn't remove packages tito and acpi (they still might be removed if they require some of the removed packages). Remove older versions of duplicated packages (an equivalent of yum's package-cleanup --cle‐ andups): dnf remove --duplicates Repoinfo Command This command is an alias for the repolist command that provides more detailed information like dnf repolist -v. Repolist Command 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 -v option is used. This command by default does not force a sync of expired metadata. See also Metadata Synchro‐ nization. Repoquery Command dnf [options] repoquery [<select-options>] [<query-options>] [<pkg-spec>] Searches the 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 list of recognized tags by repoquery option --queryformat There are also a few specific repoquery commands repoquery-n, repoquery-na and repo‐ query-nevra that allow the specification of an exact argument in NEVRA format (does not affect arguments of options like --whatprovides <arg>, ...). Select Options Together with <pkg-spec>, control what packages are displayed in the output. If <pkg-spec> is given, the set of resulting packages matching the specification. All packages are considered if no <pkg-spec> is specified. <pkg-spec> Package specification like: name[-[epoch:]version[-release]][.arch]. See Specifying Packages. -a, --all Query all packages (for rpmquery compatibility / shorthand for repoquery '*' or repo‐ query without arguments). --arch <arch>[,<arch>...] Limit the resulting set only to packages of selected architectures. (The default is all architectures.) In some cases the result is affected by basearch of 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 duplicated 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 exe‐ cuting dnf autoremove command. --available Limit the resulting set to available packages only (set by default). --extras Limit the resulting set to packages that are not present in any of available reposito‐ ries. -f <file>, --file <file> Limit the resulting set only to package that owns <file>. --installed Limit the resulting set to installed packages. The exclude option in configuration file (.conf) 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 archi‐ tecture. If <number> is negative skip <number> of latest packages. If negative number is supplied use syntax --latest-limit=<number>. --recent Limit the resulting set to packages that were recently edited. --repo <repoid> Limit the resulting set only to packages from repo 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 user. The exclude option in configura‐ tion file (.conf) might influence the result, but if the command line option -‐ -disableexcludes is used, it ensures that all installed packages will be listed. --whatdepends <capability> Limit the resulting set only to packages that require, enhance, recommend, suggest, or supplement <capability>. --whatconflicts <capability> Limit the resulting set only to packages that conflict <capability>. --whatenhances <capability> Limit the resulting set only to packages that enhance <capability>. --whatobsoletes <capability> Limit the resulting set only to packages that obsolete <capability>. --whatprovides <capability> Limit the resulting set only to packages that provide <capability>. --whatrecommends <capability> Limit the resulting set only to packages that recommend <capability>. --whatrequires <capability> Limit the resulting set only to packages that require <capability>. --whatsuggests <capability> Limit the resulting set only to packages that suggest <capability>. --whatsupplements <capability> Limit the resulting set only to packages that supplement <capability>. --alldeps This option is stackable with --whatrequires or --whatdepends only. Additionally it adds to the result set all packages requiring the package features (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 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 list of files in the package. -s, --source Show package source RPM name. --changelogs Print 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 Produces a list of all dependencies and what packages provide those dependencies for the given packages. The results only shows the newest providers (which can be changed by using --verbose) --nvr Show found packages in format name-version-release. Same as --qf "%{name}-%{ver‐ sion}-%{release}" --nevra Show found packages in format name-epoch:version-release.architecture. Same as --qf "%{name}-%{epoch}:%{version}-%{release}.%{arch}" (default) --envra Show found packages in format epoch:name-version-release.architecture. Same as --qf "%{epoch}:%{name}-%{version}-%{release}.%{arch}" --qf <format>, --queryformat <format> Custom display format. <format> is a string to output for each matched package. Every occurrence of %{<tag>} within is replaced by corresponding attribute of the package. List of recognized tags can be displayed by running dnf repoquery --querytags. --recursive Query packages recursively. Has to be used with --whatrequires <REQ> (optionaly 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*: dnf repoquery 'light*' Display NEVRAs of all available packages matching name light* and architecture noarch (accepts only arguments in format "<name>.<arch>"): dnf repoquery-na 'light*.noarch' Display requires of all ligttpd 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 duplicated packages: dnf repoquery --duplicates Display source packages that requires a <provide> for a build: dnf repoquery --disablerepo=* --enablerepo=*-source --arch=src --whatrequires <provide> Repository-Packages Command The repository-packages command allows the user to run commands on top of all packages in the repository named <repoid>. However, any dependency resolution takes into account packages from all enabled repositories. Specifications <package-name-spec> and <package-spec> further limit the candidates to only those packages matching at least one of them. info subcommand lists description and summary information about packages depending on the pack‐ ages' relation to the repository. list subcommand just dumps lists of that packages. dnf [options] repository-packages <repoid> check-update [<package-name-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. dnf [options] repository-packages <repoid> info [--all] [<package-name-spec>...] List all related packages. dnf [options] repository-packages <repoid> info --installed [<package-name-spec>...] List packages installed from the repository. dnf [options] repository-packages <repoid> info --available [<package-name-spec>...] List packages available in the repository but not currently installed on the system. dnf [options] repository-packages <repoid> info --extras [<package-name-specs>...] List packages installed from the repository that are not available in any repository. dnf [options] repository-packages <repoid> info --obsoletes [<package-name-spec>...] List packages in the repository that obsolete packages installed on the system. dnf [options] repository-packages <repoid> info --recent [<package-name-spec>...] List packages recently added into the repository. dnf [options] repository-packages <repoid> info --upgrades [<package-name-spec>...] List packages in the repository that upgrade packages installed on the system. dnf [options] repository-packages <repoid> install [<package-spec>...] Install all packages in the repository. dnf [options] repository-packages <repoid> list [--all] [<package-name-spec>...] List all related packages. dnf [options] repository-packages <repoid> list --installed [<package-name-spec>...] List packages installed from the repository. dnf [options] repository-packages <repoid> list --available [<package-name-spec>...] List packages available in the repository but not currently installed on the system. dnf [options] repository-packages <repoid> list --extras [<package-name-specs>...] List packages installed from the repository that are not available in any repository. dnf [options] repository-packages <repoid> list --obsoletes [<package-name-spec>...] List packages in the repository that obsolete packages installed on the system. dnf [options] repository-packages <repoid> list --recent [<package-name-spec>...] List packages recently added into the repository. dnf [options] repository-packages <repoid> list --upgrades [<package-name-spec>...] List packages in the repository that upgrade packages installed on the system. dnf [options] repository-packages <repoid> move-to [<package-name-spec>...] Reinstall all those packages that are available in the repository. dnf [options] repository-packages <repoid> reinstall [<package-name-spec>...] Run reinstall-old subcommand. If it fails, run move-to subcommand. dnf [options] repository-packages <repoid> reinstall-old [<package-name-spec>...] Reinstall all those packages that were installed from the repository and simultaneously are available in the repository. dnf [options] repository-packages <repoid> remove [<package-name-spec>...] Remove all packages installed from the repository along with any packages depending on the packages being removed. If clean_requirements_on_remove is enabled (the default) also removes any dependencies that are no longer needed. dnf [options] repository-packages <repoid> remove-or-distro-sync [<package-name-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 clean_requirements_on_remove is enabled (the default) also removes any dependencies that are no longer needed. dnf [options] repository-packages <repoid> remove-or-reinstall [<package-name-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 clean_requirements_on_remove is enabled (the default) also removes any dependencies that are no longer needed. dnf [options] repository-packages <repoid> upgrade [<package-name-spec>...] Update all packages to the highest resolvable version available in the repository. 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 deprecated alias for the upgrade subcommand. Search Command dnf [options] search [--all] <keywords>... Search package metadata for the keywords. Keywords are matched as case-insensitive sub‐ strings, globbing is supported. By default lists packages that match all requested keys (AND operation). Keys are searched in package names and summaries. If option "--all" is used, lists packages that match at least one of keys (OR operation). And in addition keys are searched in 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 Synchro‐ nization. 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. config [conf-option] [value] · Set a config option to a requested value. If no value is given it prints the current value. repo [list|enable|disable] [repo-id] · list: list repositories and their status · enable: enable repository · disable: disable repository transaction [list|reset|solve|run] · list: resolve and list the content of the transaction · reset: reset the transaction · run: resolve and run the transaction 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 --allowerasing option that provides functionality of 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 output type, DNF displays just counts of advisory types (omitted or --sum‐ mary), list of advisories (--list) or detailed information (--info). When --info with -v option is used, the information is even more detailed. <availability> specifies whether advisories about newer versions of installed packages (omitted or --available), advisories about equal and older versions of installed pack‐ ages (--installed), advisories about newer versions of those installed packages for which a newer version is available (--updates) or advisories about any versions of installed packages (--all) are taken into account. Most of the time, --available and --updates displays the same output. The outputs differ only in the cases when an advi‐ sory refers to a newer version but there is no enabled repository which contains any newer version. If given and if neither ID, type (bugfix, enhancement, security/sec) nor a package name of an advisory does match <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 sup‐ ported. Output of option --summary is affected by config option autocheck_running_kernel Upgrade Command dnf [options] upgrade Updates each package to the latest version that is both available and resolvable. dnf [options] upgrade <package-installed-specs>... Updates each specified package to the latest available version. Updates dependencies as necessary. dnf [options] upgrade <package-nevr-specs>... Upgrades packages to the specified versions. dnf [options] upgrade @<spec>... Alias for dnf module update command. If the main obsoletes configure option is true or the --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 dnf [options] upgrade-minimal Updates each package to the latest version that provides bugfix, enhancement or fix for security issue (security) dnf [options] upgrade-minimal <package-installed-specs>... Updates each specified package to the latest available version that provides bugfix, enhancement or 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. DNF looks for interpretations of the parameter from the most commonly used meanings to the least, that is it tries to see if the given spec fits one of the following patterns (in decreasing order of priority): · name.arch · name · name-[epoch:]version-release.arch · name-[epoch:]version-release · name-[epoch:]version Note that name can in general contain dashes (e.g. package-subpackage). Failing to match the input argument to an existing package name based on the patterns above, DNF tries to see if the argument matches an existing provide. By default, if multiple versions of the selected package exist in the repo, the most recent version suitable for the given operation is used. If the selected package exists for multiple architectures, the packages which best match the system's architecture will be preferred. The name specification is case-sensitive, globbing characters "?, * and [ are allowed and trigger shell-like glob matching. If globbing character is present in name, DNF expands given name first and consequently selects all packages matching expanded <package-spec>. <package-name-spec> is similar to <package-spec> except the provides matching is never attempted there. <package-installed-specs> is similar to <package-specs> except it considers only installed packages. SPECIFYING EXACT VERSIONS OF PACKAGES Commands accepting the <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 <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 pack‐ age) 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 possi‐ ble). SPECIFYING MODULES <module-spec> allows one to select modules or profiles a particular operation should work on. It is of form NAME:STREAM:VERSION:CONTEXT:ARCH/PROFILE and supported partial forms are the fol‐ lowing: · 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, enabled or default stream is used, in this order. In case pro‐ file is not specified, system default profile or 'default' profile is used. SPECIFYING TRANSACTIONS <transaction-spec> can be in one of several forms. If it is an integer, it specifies a transac‐ tion 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 trans‐ action preceding the most recent transaction. METADATA SYNCHRONIZATION Correct operation of DNF depends on having access to up-to-date data from all enabled reposito‐ ries 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)) repo config option is used by DNF to determine whether 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 when‐ ever 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. 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, fol‐ lowing packaging guideline. FILES Cache Files /var/cache/dnf Main Configuration /etc/dnf/dnf.conf Repository /etc/yum.repos.d/ SEE ALSO · dnf.conf(5), DNF Configuration Reference · dnf.plugin.*(8), assorted DNF plugins that might be installed on the system. · DNF project homepage (https://github.com/rpm-software-management/dnf/) · How to report a bug (https://github.com/rpm-software-management/dnf/wiki/Bug-Reporting) · YUM project homepage (http://yum.baseurl.org/) AUTHOR See AUTHORS in DNF source distribution. COPYRIGHT 2012-2014, Red Hat, Licensed under GPLv2+ 4.0.9 Feb 14, 2019 DNF(8)
© Lightnetics 2024