YUM(8)
๐
YUM(8) โ the yum page, aka the DNF Command Reference ๐
Okay bestie, so you typed man yum and this is what came out โ it's the yum page, and honestly? It's just redirecting to DNF, no cap. Sit down, grab a strawberry drink ๐, and let's get into it.
โจ NAME โจ
yum โ redirecting to DNF Command Reference. That's it, that's the whole name. She's a forwarding address at this point ๐
๐ฆ SYNOPSIS ๐ฆ
dnf [options] <command> [<args>...]
That's the whole shape of it. Options first, then the command, then whatever args the command wants. Periodt.
๐ธ DESCRIPTION ๐ธ
So DNF is the next upcoming major version of YUM โ a package manager for RPM-based Linux distributions. She roughly maintains CLI compatibility with YUM (so your old muscle memory mostly survives ๐ญ) and defines a strict API for extensions and plugins. Strict API = she has boundaries, and honestly we respect it ๐
Plugins can modify or extend features of DNF, or straight-up hand you additional CLI commands on top of the ones listed below. And here's the cute part: if you know the name of such a command (including the ones mentioned below), you may find/install the package that provides it using the appropriate virtual provide in the form of dnf-command(<alias>), where <alias> is the name of the command. Like, for example, dnf install 'dnf-command(versionlock)' installs a versionlock plugin. Slay. This approach also applies to specifying dependencies of packages that require a particular DNF command โ iykyk.
๐งฎ Return values (the vibe check on exit) ๐งฎ
0: Operation was successful. She ate. ๐ฅ1: An error occurred, which was handled by dnf.3: An unknown unhandled error occurred during operation. ๐100: Seecheck-update200: There was a problem with acquiring or releasing of locks.
๐ Available commands ๐
aliasautoremovecheckcheck-updatecleandeplistdistro-syncdowngradegrouphelphistoryinfoinstalllistmakecachemarkmoduleprovidesreinstallremoverepoinforepolistrepoqueryrepository-packagessearchshellswapupdateinfoupgradeupgrade-minimal
๐ซถ Additional information ๐ซถ
- Options
- Specifying Packages
- Specifying Provides
- Specifying File Provides
- Specifying Groups
- Specifying Transactions
- Metadata Synchronization
- Configuration Files Replacement Policy
- Files
- See Also
โจ OPTIONS โจ
Okay this is the big one, bestie โ every single flag, no skips, no "you get the idea". She's thorough ๐
-4โ Resolve to IPv4 addresses only. IPv4 girlie only ๐-6โ Resolve to IPv6 addresses only.--advisory=<advisory>,--advisories=<advisory>โ Include packages corresponding to the advisory ID, Eg.FEDORA-2201-123. Applicable for theinstall,repoquery,updateinfo,upgradeandoffline-upgrade(dnf-plugins-core) commands.--allowerasingโ Allow erasing of installed packages to resolve dependencies. This option could be used as an alternative to theyum swapcommand where packages to remove are not explicitly defined. Lowkey chaotic but she's solving problems ๐ซถ--assumenoโ Automatically answer no for all questions. The introvert flag, honestly ๐-b,--bestโ Try the best available package versions in transactions. Specifically duringdnf 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.
Note that the use of the newest available version is only guaranteed for the packages directly requested (e.g. as a command line arguments), and the solver may use older versions of dependencies to meet their requirements. So bestie, "best" is best-effort for the deps, okay? No cap on that nuance โญ
--bugfixโ Include packages that fix a bugfix issue. Applicable for theinstall,repoquery,updateinfo,upgradeandoffline-upgrade(dnf-plugins-core) commands.--bz=<bugzilla>,--bzs=<bugzilla>โ Include packages that fix a Bugzilla ID, Eg.123123. Applicable for theinstall,repoquery,updateinfo,upgradeandoffline-upgrade(dnf-plugins-core) commands.-C,--cacheonlyโ Run entirely from system cache, don't update the cache and use it even in case it is expired.
DNF uses a separate cache for each user under which it executes. The cache for the root user is called the system cache. This switch allows a regular user read-only access to the system cache, which usually is more fresh than the user's and thus he does not have to wait for metadata sync. Sharing is caring, fr fr ๐ง
--color=<color>โ Control whether color is used in terminal output. Valid values arealways,neverandauto(default).--comment=<comment>โ Add a comment to the transaction history. Little diary entry for your packages ๐-c <config file>,--config=<config file>โ Configuration file location.--cve=<cves>,--cves=<cves>โ Include packages that fix a CVE (Common Vulnerabilities and Exposures) ID (http://cve.mitre.org/about/), Eg.CVE-2201-0123. Applicable for theinstall,repoquery,updateinfo,upgradeandoffline-upgrade(dnf-plugins-core) commands.-d <debug level>,--debuglevel=<debug level>โ Debugging output level. This is an integer value between0(no additional information strings) and10(shows all debugging information, even that not understandable to the user), default is2. Deprecated, use-vinstead. She's old news, bestie ๐--debugsolverโ Dump data aiding in dependency solver debugging into./debugdata.--disableexcludes=[all|main|<repoid>],--disableexcludepkgs=[all|main|<repoid>]โ Disableexcludepkgsandincludepkgsconfiguration options. Takes one of the following three options:all, disables allexcludepkgsandincludepkgsconfigurationsmain, disablesexcludepkgsandincludepkgsdefined in the[main]sectionrepoid, disablesexcludepkgsandincludepkgsdefined for the given repository
Note that the --exclude option appends to the [main] excludepkgs configuration and therefore is disabled when main or all is specified. Important lil gotcha ๐
--disable,--set-disabledโ Disable specified repositories (automatically saves). The option has to be used together with theconfig-managercommand (dnf-plugins-core).--disableplugin=<plugin names>โ Disable the listed plugins specified by names or globs.--disablerepo=<repoid>โ Temporarily disable active repositories for the purpose of the currentdnfcommand. Accepts an id, a comma-separated list of ids, or a glob of ids. This option can be specified multiple times, but is mutually exclusive with--repo. PICK ONE, bestie ๐ญ--downloaddir=<path>,--destdir=<path>โ Redirect downloaded packages to provided directory. The option has to be used together with the--downloadonlycommand line option, with thedownload,modulesync,reposyncorsystem-upgradecommands (dnf-plugins-core).--downloadonlyโ Download the resolved package set without performing any rpm transaction (install/upgrade/erase).
Packages are removed after the next successful transaction. This applies also when used together with --destdir option as the directory is considered as a part of the DNF cache. To persist the packages, use the download command instead. So she downloads and then bins them โ that's not a bug, that's the deal ๐
-e <error level>,--errorlevel=<error level>โ Error output level. This is an integer value between0(no error output) and10(shows all error messages), default is3. Deprecated, use-vinstead.--enable,--set-enabledโ Enable specified repositories (automatically saves). The option has to be used together with theconfig-managercommand (dnf-plugins-core).--enableplugin=<plugin names>โ Enable the listed plugins specified by names or globs.--enablerepo=<repoid>โ Temporarily enable additional repositories for the purpose of the currentdnfcommand. Accepts an id, a comma-separated list of ids, or a glob of ids. This option can be specified multiple times.--enhancementโ Include enhancement relevant packages. Applicable for theinstall,repoquery,updateinfo,upgradeandoffline-upgrade(dnf-plugins-core) commands.-x <package-file-spec>,--exclude=<package-file-spec>โ Exclude packages specified by<package-file-spec>from the operation.--excludepkgs=<package-file-spec>โ Deprecated option. It was replaced by the--excludeoption. She's retired, respect her legacy ๐--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--forcearchcan be configured by using thearchandignorearchconfiguration options with values<arch>andTruerespectively. Manifesting a whole different CPU โจ-h,--help,--help-cmdโ Show the help.--installroot=<path>โ Specifies an alternative installroot, relative to where all packages will be installed. Think of this like doingchroot <root> dnf, except using--installrootallowsdnfto work before the chroot is created. It requires absolute path.cachedir, log files,releasever, andgpgkeyare 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
reposdirare 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 (--config=<config file>in case of configuration file and--setopt=reposdir=<reposdir>forreposdir) then this path is always relative to the host with no exceptions. varsare taken from the host system or installroot according toreposdir. Whenreposdirpath is specified within a command line argument,varsare taken from the installroot. Whenvarsdirpaths are specified within a command line argument (--setopt=varsdir=<reposdir>) then those path are always relative to the host with no exceptions.- The
pluginpathandpluginconfpathare relative to the host.
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 installroot (and thus it is empty at the time of creation and the transaction will fail). If --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 repository, releasever and dnf.conf files.
Bestie, that installroot section is dense but it's giving very important. Read it twice, it's cheaper than a failed transaction ๐
On a modular system, bestie, you're also gonna want to use the --setopt=module_platform_id=<module_platform_name:stream> command-line option when you create the installroot โ otherwise the module_platform_id value gets grabbed from the /etc/os-release file inside the installroot (so it's literally empty at creation time, the modular dependency could end up unsatisfied, and module content could get excluded ๐ญ). Don't let that happen to you.
Installroot examples, because examples are everything:
dnf --installroot=<installroot> --releasever=<release> install system-release
Permanently sets the releasever of the system in the <installroot> directory to <release>. Permanently. Like a tattoo. โจ
dnf --installroot=<installroot> --setopt=reposdir=<path> --config /path/dnf.conf upgrade
Upgrades packages inside the installroot from a repository described by --setopt using configuration from /path/dnf.conf. Iconic behavior, no notes. ๐
--newpackageโ include newpackage relevant packages. Applicable for theinstall,repoquery,updateinfo,upgradeandoffline-upgrade(dnf-plugins-core) commands.--noautoremoveโ disables removal of dependencies that are no longer used. It sets theclean_requirements_on_removeconfiguration option toFalse. Basically "don't clean up after me, I'm not done yet."--nobestโ sets the best option toFalse, so that transactions are not limited to best candidates only. You get the whole menu, not just the chef's special. ๐--nodocsโ do not install documentation. Sets the rpm flag'RPMTRANS_FLAG_NODOCS'. No docs, no problem, we're busy.--nogpgcheckโ skip checking GPG signatures on packages (if RPM policy allows). โ ๏ธ Yes, this is exactly as spicy as it sounds.--nopluginsโ disable all plugins. Every single one. Periodt.--obsoletesโ this option has an effect on an install/update: it enables dnf's obsoletes processing logic. For more information see theobsoletesoption.
This option also displays capabilities that the package obsoletes when used together with the repoquery command.
Configuration Option: obsoletes
-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. Lowkey just "shhh, I know what's happening." ๐คซ-R <minutes>,--randomwait=<minutes>โ maximum command wait time.--refreshโ set metadata as expired before running the command. Like clearing your cache before you re-stalk someone's profile. ๐ฆ--releasever=<release>โ configure DNF as if the distribution release was<release>. This can affect cache paths, values in configuration files and mirrorlist URLs.--releasever_major=<major version>โ override thereleasever_majorvariable, which is usually automatically detected or taken from the part of$releaseverbefore the first.. This option does not affect the$releasevervariable. Read that twice, fr fr.--releasever_minor=<minor version>โ override thereleasever_minorvariable, which is usually automatically detected or taken from the part of$releaseverafter the first.. This option does not affect the$releasevervariable either. Same energy, different half of the string. ๐--repofrompath <repo>,<path/url>โ specify a repository to add to the repositories for this query. This option can be used multiple times.- The repository label is specified by
<repo>. - The path or url to the repository is specified by
<path/url>. It is the same path as abaseurland can be also enriched by the repo variables. - The configuration for the repository can be adjusted using
--setopt=<repo>.<option>=<value>. - If you want to view only packages from this repository, combine this with the
--repo=<repo>or--disablerepo="*"switches.
- The repository label is specified by
--repo=<repoid>,--repoid=<repoid>โ enable just specific repositories by an id or a glob. Can be used multiple times with accumulative effect. It is basically a shortcut for--disablerepo="*" --enablerepo=<repoid>and is mutually exclusive with the--disablerepooption. Pick a lane, bestie. ๐ซถ--rpmverbosity=<name>โ RPM debug scriptlet output level. Sets the debug level to<name>for RPM scriptlets. For available levels, see therpmverbosityconfiguration option.--sec-severity=<severity>,--secseverity=<severity>โ includes packages that provide a fix for an issue of the specified severity. Applicable for theinstall,repoquery,updateinfo,upgradeandoffline-upgrade(dnf-plugins-core) commands.--securityโ includes packages that provide a fix for a security issue. Applicable for theinstall,repoquery,updateinfo,upgradeandoffline-upgrade(dnf-plugins-core) commands. Security patch drop, let's go ๐ฅ--setopt=<option>=<value>โ override a configuration option from the configuration file. To override configuration options for repositories, userepoid.optionfor the<option>. Values for configuration options likeexcludepkgs,includepkgs,installonlypkgsandtsflagsare appended to the original value โ they do not override it. However, specifying an empty value (e.g.--setopt=tsflags=) will clear the option. Sneaky but valid. ๐--skip-brokenโ resolve depsolve problems by removing packages that are causing problems from the transaction. It is an alias for thestrictconfiguration option with valueFalse. Additionally, with theenableanddisablemodule subcommands it allows one to perform an action even in case of broken modular dependencies. It's giving "we move." ๐--showduplicatesโ show duplicate packages in repositories. Applicable for thelistandsearchcommands.--transientโ applicable only on bootc (bootable containers) systems. Perform transactions using a transient overlay which will be lost on the next reboot. See also thepersistenceconfiguration option. It's giving "this never happened" energy. ๐-v,--verboseโ verbose operation, show debug messages. For when you need to know everything.--versionโ show DNF version and exit.-y,--assumeyesโ automatically answer yes for all questions. No thoughts, head empty, just yes. ๐
List options are comma-separated. Command-line options override respective settings from configuration files. That's the rule and honestly it's a good rule.
๐ COMMANDS ๐
For an explanation of <package-spec>, <package-file-spec> and <package-name-spec> see Specifying 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 ๐
Command: alias
Allows the user to define and manage a list of aliases (in the form <name=value>), which can be then used as dnf commands to abbreviate longer command sequences. For examples on using the alias command, see Alias Examples. For examples on the alias processing, see Alias Processing Examples. Bestie, it's a nickname maker for your commands. ๐ธ
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. DNF said "not today, loop." ๐
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 /etc/dnf/aliases.d/ directory in the [aliases] section, and aliases created by the alias command are written to the USER.conf file. In case of conflicts, the USER.conf has the highest priority, and alphabetical ordering is used for the rest of the configuration files.
Optionally, there is the enabled option in the [main] section defaulting to True. This can be set for each file separately in the respective file, or globally for all aliases in the ALIASES.conf file.
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. Full roster reveal. โจdnf alias add rm=removeโ adds a new command alias calledrmwhich works the same as theremovecommand.dnf alias add upgrade="\upgrade --skip-broken --disableexcludes=all --obsoletes"โ adds a new command alias calledupgradewhich works the same as theupgradecommand, with additional options. Note that the originalupgradecommand is prefixed with a\to prevent an infinite loop in alias processing. That backslash is the main character here, honestly. ๐
๐ Alias Processing Examples ๐
If there are defined aliases in=install and FORCE="--skip-broken --disableexcludes=all":
dnf FORCE inwill be replaced withdnf --skip-broken --disableexcludes=all installdnf in FORCEwill be replaced withdnf install FORCE(which will fail)
If there is defined alias in=install:
dnf inwill be replaced withdnf installdnf --repo updates inwill be replaced withdnf --repo updates in(which will fail)
See how order matters? Position is everything, iykyk. ๐
๐ง Autoremove Command ๐ง
Command: autoremove Aliases for explicit NEVRA matching: autoremove-n, autoremove-na, autoremove-nevra
dnf [options] autoremove
Removes all packages from the system that were originally installed as dependencies of user-installed packages, but which are no longer required by any such package. It's the cleanup crew your system didn't know it needed. ๐
dnf [options] autoremove <spec>...
This is an alias for the 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 package 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 autoremove-nevra that allow the specification of an exact argument in the NEVRA (name-epoch:version-release.architecture) format.
Heads up: this command by default does not force a sync of expired metadata. See also Metadata Synchronization. So don't come for it about stale info, bestie.
โญ Check Command โญ
Command: check
dnf [options] check [--dependencies] [--duplicates] [--obsoleted] [--provides]
Checks the local packagedb and produces information on any problems it finds. You can limit the checks to be performed by using the --dependencies, --duplicates, --obsoleted and --provides options (the default is to check everything). It's a vibe check for your package database, and yes it will absolutely tell you what's wrong. ๐
๐ธ Check-Update Command ๐ธ
Command: check-update Aliases: check-upgrade
dnf [options] check-update [--changelogs] [<package-file-spec>...]
Okay so this one is the "do I have updates or not" checker, and it does it without asking you anything โ non-interactive, no prompts, no drama. It checks whether updates are available for the packages you name. Leave out <package-file-spec> entirely and it just checks whether anything at all on your system has an update waiting. ๐
The exit codes here are lowkey iconic and you have to memorise them:
100โ yep, updates available, and it prints you the list ๐ฅ0โ nope, you're all up to date, slay โจ1โ something broke ๐ญ
Add --changelogs and it also prints the changelog delta of the packages that are about to be updated. Bestie, receipts. ๐
โ ๏ธ Real talk though: just becausecheck-updatesays a newer version exists doesn't mean a laterdnf upgradewill actually install it. Not the same thing at all. The difference is thatdnf upgradehas restrictions to respect โ like package dependencies actually being satisfiable. So don't come for DNF when the upgrade "ignores" your update. It's not ignoring you, it's doing math. ๐งฎ
Also heads up: the output is affected by the autocheck_running_kernel configuration option. ๐
๐งผ Clean Command ๐งผ
Command: clean
This is the self-care command fr fr. ๐ It performs cleanup of the temporary files that get kept around for repositories โ and that includes all the leftover data from disabled or removed repositories, plus data for different distribution release versions. Basically it sweeps under the bed, including the stuff from three moves ago. ๐งน
dnf clean dbcacheโ Removes the cache files generated from the repository metadata. This forces DNF to regenerate those cache files the next time it runs. ๐dnf clean expire-cacheโ Marks the repository metadata as expired. DNF will re-validate the cache for each repository the next time it's used. โณdnf clean metadataโ Removes the repository metadata itself. Those are the files DNF uses to figure out the remote availability of packages. Use this and DNF will download all the metadata next time it runs. ๐ซdnf clean packagesโ Removes any cached packages from the system. ๐ฆdnf clean allโ Does all of the above. The full reset. The factory settings. The everything shower. ๐ฟ
๐๏ธ Deplist Command ๐๏ธ
dnf [options] deplist [<select-options>] [<query-options>]
[<package-spec>]
Deprecated alias for dnf repoquery --deplist. That's it, that's the whole thing. It's giving "old account you forgot to deactivate" ๐ โ still works, but the cool kids use repoquery.
๐ Distro-Sync Command ๐
Command: distro-sync Aliases: dsync Deprecated aliases: distrosync, distribution-synchronization
dnf distro-sync [<package-spec>...]
As necessary, it upgrades, downgrades, or keeps your selected installed packages so they match the latest version available from any enabled repository. Note the "as necessary" โ it will absolutely downgrade you if that's what it takes. No loyalty. ๐ค If you don't give it a package, all installed packages get considered. ๐
See also Configuration Files Replacement Policy.
๐ Downgrade Command ๐
Command: downgrade Aliases: dg
dnf [options] downgrade <package-spec>...
Downgrades the packages you name to the highest installable package of all known lower versions, if that's possible. And if you hand it a version yourself, and that version is lower than the version of the installed package, then it downgrades to that target version. Rollback era. ๐ฐ๏ธ Sometimes you gotta go backwards to go forwards.
๐ฏ Group Command ๐ฏ
Command: group Aliases: grp Deprecated aliases: groups, grouplist, groupinstall, groupupdate, groupremove, grouperase, groupinfo
Groups are virtual collections of packages โ think of them like a curated playlist instead of buying every song individually. ๐ง DNF keeps track of the groups you selected ("marked") as installed, and can then manipulate all the packages inside them with simple commands. Main character groupchat energy. ๐
dnf [options] group [summary] <group-spec>
Displays an overview of how many groups are installed and how many are available. Give it a spec and it limits the output to the matching groups. summary is the default groups subcommand, so if you type nothing else, that's what you get. ๐
dnf [options] group info <group-spec>
Displays the package lists of a group. It shows you which packages are installed or available from a repository โ but only when you use -v. ๐
dnf [options] group install [--with-optional] <group-spec>...
Marks the specified group as installed and installs the packages it contains. Add --with-optional and it also pulls in the group's optional packages. ๐
The rules, spelled out: all Mandatory and Default packages will be installed whenever possible. Conditional packages are installed if they meet their requirement. And if the group is already (partially) installed, the command just installs the missing packages from it. Depending on the value of the obsoletes configuration option, group installation takes obsoletes into account. ๐ง
dnf [options] group list <group-spec>...
Lists all matching groups, either among installed ones or available ones. Specify nothing and it lists every known group. --installed and --available narrow down the list you're asking for. ๐
Records are ordered by the display_order tag defined in the comps.xml file. And it'll give you a list of all hidden groups if you use --hidden. It provides group IDs when you use -v or --ids. iykyk ๐ซถ
dnf [options] group remove <group-spec>...
Marks the group as removed, and removes those packages in the group from the system which do not belong to another installed group and were not installed explicitly by the user. So it's careful โ it's not gonna uninstall your faves just because they were also in a group. ๐
dnf [options] group upgrade <group-spec>...
Upgrades the packages from the group, and upgrades the group itself. That second part means installing packages that were added to the group by the distribution, and removing packages that got removed from the group โ but only as far as they weren't installed explicitly by the user. Glow-up for the whole squad. โจ
Groups can also be marked installed or removed without physically manipulating any packages โ like, changing the vibe without touching the files:
dnf [options] group mark install <group-spec>...
Marks the specified group as installed. No packages will be installed by this command โ but after this, the group is considered installed. Just a flag. ๐ฉ
dnf [options] group mark remove <group-spec>...
Marks the specified group as removed. No packages will be removed by this command. Also just a flag. ๐ฉ
See also Configuration Files Replacement Policy.
๐ Help Command ๐
Command: help
dnf help [<command>]
Displays the help text for all commands. If you give it a command name, it only displays the help for that particular command. The "just tell me about this one thing" button. ๐ซถ
๐ History Command ๐
Command: history Aliases: hist
The history command lets you view what has happened in past transactions and act according to that information โ assuming the history_record configuration option is set. It's your DNF browser history but, like, actually useful and not embarrassing. ๐ญ
dnf history [list] [--reverse] [<spec>...]
The default history action: listing information about the given transactions in a table. Each <spec> can be any of:
- a
<transaction-spec>, which specifies a transaction directly, - 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, it lists all known transactions. ๐๏ธ
๐ Worth knowing: transient transactions (see--transient) will be listed, even though they don't make persistent changes to files under/usror to the RPM database. They're in the groupchat even if they never showed up to the party.
The "Action(s)" column lists each type of action taken in the transaction. The possible values are:
- Install (I): a new package was installed on the system
- Downgrade (D): an older version of a package replaced the previously-installed version
- Obsolete (O): an obsolete package was replaced by a new package
- Upgrade (U): a newer version of the package replaced the previously-installed version
- Remove (E): a package was removed from the system
- Reinstall (R): a package was reinstalled with the same version
- Reason change (C): a package was kept in the system but its reason for being installed changed
The "Altered" column lists the number of actions taken in each transaction, possibly followed by one or two of these symbols:
>โ The RPM database was changed, outside DNF, after the transaction<โ The RPM database was changed, outside DNF, before the transaction*โ The transaction aborted before completion ๐#โ The transaction completed, but with a non-zero statusEโ The transaction completed successfully, but had warning/error output--reverseโ The order of the history list output is printed in reverse order. ๐
dnf history info [<spec>...]
Describes the given transactions. The meaning of <spec> is exactly the same as in the History List Command. When no transaction is specified, it describes what happened during the latest transaction. ๐
dnf history redo <transaction-spec>|<package-file-spec>
Repeats the specified transaction. It uses the last transaction (with the highest ID) if more than one transaction for the given <package-file-spec> is found. And if it's not possible to redo some operations due to the current state of RPMDB, it will not redo the transaction. No partial sends. ๐ซ
dnf history replay [--ignore-installed] [--ignore-extras] [--skip-unavailable] <filename>
Replays a transaction stored in the file <filename> by the History Store Command. The replay performs the exact same operations on the packages as in the original transaction, and it returns an error if there are any differences in installed packages or their versions. Precision only. ๐ฏ See also the Transaction JSON Format specification of the file format.
--ignore-installedโ Don't check that the installed packages are in the same state as the ones recorded in the transaction. E.g. in case there's an upgradefoo-1.0->foo-2.0stored in the transaction, but there'sfoo-1.1installed on the target system. ๐--ignore-extrasโ Don't check for extra packages pulled into the transaction on the target system. E.g. the target system may not have some dependency which was installed on the source system. The replay errors out on this by default, since the transaction wouldn't be the same. ๐ค--skip-unavailableโ In case some packages stored in the transaction aren't available on the target system, skip them instead of erroring out. ๐ฉน
dnf history rollback <transaction-spec>|<package-file-spec>
Undoes all transactions performed after the specified transaction. It uses the last transaction (with the highest ID) if more than one transaction for the given <package-file-spec> is found. And if it's not possible to undo some transactions due to the current state of RPMDB, it will not undo any transaction. All or nothing, bestie. ๐
dnf history store [--output <output-file>] <transaction-spec>
Stores a transaction โ the one you point at with <transaction-spec> โ so you can replay it later with the History Replay Command. It's giving time capsule vibes ๐
Warning bestie: the stored transaction format is considered unstable and may change at any time ๐ญ It will work if the same version of dnf is used to store and replay (or between versions as long as it stays the same).
-o <output-file>,--output=<output-file>โ stashes the serialized transaction into <output-file>. Default istransaction.json. ๐๏ธ
dnf history undo <transaction-spec>|<package-file-spec>
Does the literal opposite of every operation performed in the transaction you specify. If more than one transaction matches the given <package-file-spec>, it uses the last transaction (the one with the highest ID). And heads up โ if it's not possible to undo some operations because of the current state of RPMDB, it will not undo the transaction. No partial chaos, no cap ๐
dnf history userinstalled
Shows all packages installed by user, installed from a group or a module profile, and packages installed outside of DNF. Basically it lists the packages that will stay on your system when the Autoremove Command or Remove Command (along with clean_requirements_on_remove configuration option set to True) is executed. ๐ซถ
Ngl, you can get the same results with dnf repoquery --userinstalled, and honestly the repoquery command is more powerful when it comes to formatting the output. Just saying. โจ
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 ๐ธ
Command: info Aliases: if
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 does. ๐
This command by default does not force a sync of expired metadata. See also Metadata Synchronization.
๐ Install Command ๐
Command: install Aliases: in Aliases for explicit NEVRA matching: install-n, install-na, install-nevra Deprecated aliases: localinstall
dnf [options] install <spec>...
Makes sure the given packages and their dependencies are installed on the system. Each <spec> can be either a <package-spec>, or a @<module-spec>, or a @<group-spec>. (See Install Examples below, it's literally right there ๐ซถ) If a given package or provide cannot be (and is not already) installed, the exit code will be non-zero. And if the <spec> matches both a @<module-spec> and a @<group-spec>, only the module is installed. The module ate, periodt.
When a <package-spec> specifying 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. ๐ฅ
On the other hand, if <package-spec> specifies only a name, DNF also takes into account packages obsoleting it when picking which package to install. This behaviour is specific to the install command. Note that this can lead to seemingly unexpected results if a package has multiple versions and some older version is being obsoleted โ it creates a split in the upgrade-path and both ways are considered correct, and the resulting package is picked simply by lexicographical order. ๐ญ Not me getting picked by alphabetical order.
There are also a few specific install commands install-n, install-na and install-nevra that allow the specification of an exact argument in the NEVRA format. As a consequence, <spec> will be not matched with provides and file provides. ๐
See also Configuration Files Replacement Policy.
๐ฆ Install Examples ๐ฆ
dnf install tito
Installs the tito package (tito is the package name). Simple, iconic, no notes.
dnf install ~/Downloads/tito-0.6.2-1.fc22.noarch.rpm
Installs a local rpm file tito-0.6.2-1.fc22.noarch.rpm from the ~/Downloads/ directory. Local file, local slay ๐
dnf install tito-0.5.6-1.fc22
Installs the package with a specific version. If the package is already installed it will automatically try to downgrade or upgrade to that specific version. Commit to the bit ๐
dnf --best install tito
Installs the latest available version of the package. If the package is already installed it will try to automatically upgrade to the latest version. And if the latest version of the package cannot be installed, the installation will fail. --best is highkey an overachiever.
dnf install vim
DNF will automatically recognize that vim is not a package name, but will look up and install a package that provides vim with all the required dependencies. ๐ Note: package name match has precedence over package provides match.
dnf install https://kojipkgs.fedoraproject.org//packages/tito/0.6.0/1.fc22/noarch/tito-0.6.0-1.fc22.noarch.rpm
Installs a package directly from a URL. Copy that whole URL exactly bestie, every slash matters, there's a double slash in there and we respect it ๐ซก
dnf install '@docker'
Installs all default profiles of module docker and their RPMs. Module streams get enabled accordingly. ๐ณ
dnf install '@Web Server'
Installs the Web Server environmental group. Group chat energy fr fr.
dnf install /usr/bin/rpmsign
Installs a package that provides the /usr/bin/rpmsign file. File-path flex ๐
dnf -y install tito --setopt=install_weak_deps=False
Installs the tito package (tito is the package name) without weak deps. Weak deps are not required for core functionality of the package, but they enhance the original package (like extended documentation, plugins, additional functions, etc.). They're the little extras, the accessories of the package world ๐
dnf install --advisory=FEDORA-2018-b7b99fe852 \*
Installs all packages that belong to the "FEDORA-2018-b7b99fe852" advisory. โญ
โจ List Command โจ
Command: list Aliases: ls
Prints lists of packages depending on the packages' relation to the system. A package is installed if it is present in the RPMDB, and it is available if it is not installed but is present in a repository that DNF knows about. ๐
The list command 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. No hiding, full transparency ๐ซถ
dnf [options] list [--all] [<package-file-spec>...]
Lists all packages, present in the RPMDB, in a repository or both.
dnf [options] list --installed [<package-file-spec>...]
Lists installed packages.
dnf [options] list --available [<package-file-spec>...]
Lists available packages.
dnf [options] list --extras [<package-file-spec>...]
Lists extras, that is packages installed on the system that are not available in any known repository. The orphans, the mystery guests ๐
dnf [options] list --obsoletes [<package-file-spec>...]
Lists packages installed on the system that are obsoleted by packages in any known repository.
dnf [options] list --recent [<package-file-spec>...]
Lists packages recently added into the repositories. Fresh drops ๐
dnf [options] list --upgrades [<package-file-spec>...]
Lists upgrades available for the installed packages.
dnf [options] list --autoremove
Lists packages which will be removed by the dnf autoremove command.
This command by default does not force a sync of expired metadata. See also Metadata Synchronization.
๐ง Makecache Command ๐ง
Command: makecache Aliases: mc
dnf [options] makecache
Downloads and caches metadata for enabled repositories. Tries to avoid downloading whenever possible (e.g. when the local metadata hasn't expired yet or when the metadata timestamp hasn't changed). Efficiency is the vibe ๐โจ
dnf [options] makecache --timer
Like plain makecache, but instructs DNF to be more resource-aware โ meaning it will not do anything if running on battery power, it will terminate immediately if it's too soon after the last successful makecache run (see dnf.conf(5), metadata_timer_sync), and if the first mirror in a repository mirrorlist fails, it will not try to synchronize the metadata from more mirrors for that repository. Low-power mode, literally ๐ฑ
๐ Mark Command ๐
Command: mark
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 the Autoremove Command or Remove Command (along with clean_requirements_on_remove configuration option set to True) is executed. Protecting your faves ๐ซถ
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 the Autoremove Command or Remove Command (along with clean_requirements_on_remove configuration option set to True) is executed. You should use this operation instead of the Remove Command if you're not sure whether the package is a requirement of other user installed packages on the system. Safe un-committing, bestie ๐
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. Group protection squad ๐
๐ Module Command ๐
Command: module
Modularity overview is available at man page dnf.modularity(7). Module subcommands take <module-spec>... arguments that specify modules or profiles.
dnf [options] module install <module-spec>...
Installs 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. Use the dnf module switch-to command for that. Different tool, different job, iykyk.
dnf [options] module update <module-spec>...
Updates 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. Targeted update, main character energy ๐
๐ module switch-to โ the glow-up command
dnf [options] module switch-to <module-spec>...
Okay bestie, this one is a whole moment. It switches to or enables a module stream, changes versions of installed packages to versions provided by the new stream, and removes packages from the old stream that are no longer available. It also updates installed profiles if they are available for the new stream. When a profile was provided, it installs that profile and does not update any already installed profiles.
This command can be used as a stronger version of the dnf module enable command, which not only enables modules, but also does a distrosync to all modular packages in the enabled modules. iconic behavior honestly โจ
It can also be used as a stronger version of the dnf module install command, but it requires you to specify profiles that are supposed to be installed, because switch-to command does not use default profiles. The switch-to command doesn't only install profiles, it also makes a distrosync to all modular packages in the installed module. ๐
๐งผ module remove
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. ๐ซถ
๐งจ module remove --all
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. No cap. ๐ซ
โ
module enable
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. heads up! โ ๏ธ
This command cannot be used for switching module streams. Use the dnf module switch-to command for that. don't try it bestie ๐
๐ซ module disable
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.
๐ module reset
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. fresh start energy ๐ฑ
๐ module provides
dnf [options] module provides <package-name-spec>...
Lists all modular packages matching <package-name-spec> from all modules (including disabled), along with the modules and streams they belong to. detective mode activated ๐ต๏ธโโ๏ธ
๐ฆ module list
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.
โน๏ธ module info
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.
๐ module repoquery
dnf [options] module repoquery <module-spec>...
List all available packages belonging to selected modules.
dnf [options] module repoquery --available <module-spec>...
List all available packages belonging to selected modules.
dnf [options] module repoquery --installed <module-spec>...
List all installed packages with same name like packages belonging to selected modules.
๐ Provides Command
Command: provides
Aliases: prov, whatprovides, wp
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. The <provide-spec> is gradually looked for at following locations: follow the trail bestie ๐ฆ
- The
<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
- 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
- DNF assumes that the
<provide-spec>is a system command, prepends it with/usr/bin/,/usr/sbin/prefixes (one at a time) and does the file provides search again. For legacy reasons (packages that didn't do UsrMove) also/binand/sbinprefixes are being searched:
$ dnf provides zless
gzip-1.9-9.fc29.x86_64 : The GNU data compression program
Matched from:
Filename : /usr/bin/zless
- If this last step also fails, DNF returns
"Error: No Matches found". oof, no matches bestie ๐ญ
This command by default does not force a sync of expired metadata. See also Metadata Synchronization.
โป๏ธ Reinstall Command
Command: reinstall
Aliases: rei
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). same package, fresh start ๐
๐๏ธ Remove Command
Command: remove
Aliases: rm
Aliases for explicit NEVRA matching: remove-n, remove-na, remove-nevra
Deprecated aliases: erase, erase-n, erase-na, erase-nevra
dnf [options] remove <package-spec>...
Removes the specified packages from the system along with any packages depending on the packages being removed. Each <spec> can be either a <package-spec>, which specifies a package directly, or a @<group-spec>, which specifies an (environment) group which contains it. If clean_requirements_on_remove is enabled (the default), also removes any dependencies that are no longer needed. bye bye dependency clutter ๐
๐ง remove --duplicates
dnf [options] remove --duplicates
Removes older versions of duplicate packages. To ensure the integrity of the system it reinstalls the newest package. In some cases the command cannot resolve conflicts. In such cases the dnf shell command with remove --duplicates and upgrade dnf-shell sub-commands could help. conflict era, be careful โ ๏ธ
๐งน remove --oldinstallonly
dnf [options] remove --oldinstallonly
Removes old installonly packages, keeping only latest versions and version of running kernel.
There are also a few specific remove commands remove-n, remove-na and remove-nevra that allow the specification of an exact argument in the NEVRA format. As a consequence, <spec> will be not matched with provides and file provides. precise queen behavior ๐
๐งฝ Remove Examples
dnf remove acpi titoโ Remove theacpiandtitopackages.dnf remove $(dnf repoquery --extras --exclude=tito,acpi)โ Remove packages not present in any repository, but don't remove thetitoandacpipackages (they still might be removed if they depend on some of the removed packages).dnf remove --duplicatesโ Remove older versions of duplicated packages (an equivalent of yum'spackage-cleanup --cleandups).
๐ Repoinfo Command
Command: repoinfo
An alias for the repolist command that provides more detailed information like dnf repolist -v. extra detail, extra slay โจ
๐ Repolist Command
Command: repolist
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 Synchronization.
๐ Repoquery Command
Command: repoquery
Aliases: rq
Aliases for explicit NEVRA matching: repoquery-n, repoquery-na, repoquery-nevra
dnf [options] repoquery [<select-options>] [<query-options>] [<package-file-spec>]
Searches available DNF repositories for selected packages and displays the requested information about them. It is an equivalent of rpm -q for remote repositories. remote lookup realness ๐ซถ
dnf [options] repoquery --groupmember <package-spec>...
List groups that contain <package-spec>.
dnf [options] repoquery --querytags
Provides the list of tags recognized by the --queryformat repoquery option.
There are also a few specific repoquery commands repoquery-n, repoquery-na and repoquery-nevra that allow the specification of an exact argument in the NEVRA format (does not affect arguments of options like --whatprovides <arg>, ...). As a consequence, <spec> will be not matched with file provides. exact match, no guessing ๐ฏ
๐๏ธ Select Options
Together with <package-file-spec>, control what packages are displayed in the output. If <package-file-spec> is given, limits the resulting set of packages to those matching the specification. All packages are considered if no <package-file-spec> is specified.
<package-file-spec>โ Package specification in the NEVRA format (name[-[epoch:]version[-release]][.arch]) or a file provide. See Specifying Packages.-a,--allโ Query all packages (forrpmquerycompatibility, also a shorthand forrepoquery '*'orrepoquerywithout arguments).--arch <arch>[,<arch>...],--archlist <arch>[,<arch>...]โ Limit the resulting set only to packages of selected architectures (default is all architectures). In some cases the result is affected by thebasearchof the running system, therefore to runrepoqueryfor an arch incompatible with your system use the--forcearch=<arch>option to change thebasearch. architectural main character energy ๐--duplicatesโ narrows the result down to installed duplicate packages, like when you've got more than one version of the same name-and-architecture chilling on your system. Heads up bestie: installonly packages get excluded from this set ๐--unneededโ narrows the result down to leaf packages that were installed as dependencies and likeโฆ aren't needed anymore? Basically it shows you the packages that are gonna get yeeted after you run thednf autoremovecommand ๐--availableโ narrows the result to available packages only. This one's set by default, so it's the normie setting fr--disable-modular-filteringโ turns OFF the filtering of modular packages, so packages from inactive module streams get included in your result. iconic switch honestly ๐ธ--extrasโ narrows the result down to packages that aren't present in any of the available repositories โจ-f <file>,--file <file>โ narrows the result to only the package that owns<file>. iykyk, super handy ๐--installedโ narrows the result to installed packages only. Ngl theexcludeoption in the config file might influence your result โ but if you also pass the command line option--disableexcludes, then it's guaranteed that all installed packages will be listed ๐ซถ--installonlyโ narrows the result down to installed installonly packages โญ--latest-limit <number>โ narrows the result to<number>of latest packages for every package name and architecture. If<number>is negative, it skips<number>of the latest packages instead. And for a negative<number>, you gotta use the--latest-limit=<number>syntax ๐--recentโ narrows the result to packages that were recently edited ๐ฆ--repo <repoid>โ narrows the result to only packages from the repository identified by<repoid>. You can use this multiple times and the effect stacks up (accumulative, bestie) ๐ฅ--unsatisfiedโ reports unsatisfied dependencies among installed packages, aka missing requires AND existing conflicts ๐ญ--upgradesโ narrows the result to packages that provide an upgrade for some package you already have installed โฌ๏ธ--userinstalledโ narrows the result to packages installed by the user. Same situation as--installed: theexcludeoption in the config file might influence the result, but if you use the command line option--disableexcludes, it ensures all installed packages get listed ๐--whatdepends <capability>[,<capability>...]โ narrows the result to only packages that require, enhance, recommend, suggest or supplement any of<capabilities>. It's giving "the whole crew" energy ๐--whatconflicts <capability>[,<capability>...]โ narrows the result to only packages that conflict with any of<capabilities>. drama detector ๐--whatenhances <capability>[,<capability>...]โ narrows the result to only packages that enhance any of<capabilities>. Girl, use--whatdependsif you actually want all the depending packages listed ๐--whatobsoletes <capability>[,<capability>...]โ narrows the result to only packages that obsolete any of<capabilities>๐--whatprovides <capability>[,<capability>...]โ narrows the result to only packages that provide any of<capabilities>โจ--whatrecommends <capability>[,<capability>...]โ narrows the result to only packages that recommend any of<capabilities>. Again: use--whatdependsif you want all the depending packages listed ๐ซถ--whatrequires <capability>[,<capability>...]โ narrows the result to only packages that require any of<capabilities>. And yep, use--whatdependsif you want all the depending packages listed ๐ธ--whatsuggests <capability>[,<capability>...]โ narrows the result to only packages that suggest any of<capabilities>. You already know the drill:--whatdependsfor all depending packages ๐ฆ--whatsupplements <capability>[,<capability>...]โ narrows the result to only packages that supplement any of<capabilities>. And once more for the cheap seats:--whatdependslists all depending packages โญ--alldepsโ this one is stackable with--whatrequiresor--whatdependsonly. On top of that it adds all packages requiring the package features to the result set. It's used as the default, no cap ๐--exactdepsโ also stackable with--whatrequiresor--whatdependsonly. It limits the resulting set to only packages that require the<capability>specified by--whatrequires. Precise queen behaviour ๐--srpmโ operate on the corresponding source RPM ๐
๐ Query Options ๐
This is where you pick what info gets displayed about each package ๐
Okay so listen: the following are mutually exclusive, meaning at most one can be specified. If you don't give any query option, the matching packages just get displayed in the standard NEVRA notation. Periodt.
-i,--infoโ show detailed information about the package ๐ซถ-l,--listโ show the list of files in the package ๐-s,--sourceโ show the package source RPM name โจ--changelogsโ print the package changelogs ๐--conflictsโ display capabilities that the package conflicts with. Same as--qf "%{conflicts}(yes that's literally how it's written, don't come for me ๐ญ)--dependsโ display capabilities that the package depends on, enhances, recommends, suggests or supplements ๐--enhancesโ display capabilities enhanced by the package. Same as--qf "%{enhances}""(double quote at the end, that's canon, it's in the source fr)--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%prescript. 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 these supplementary options:--whatrequires,--requires,--conflicts,--enhances,--suggests,--provides,--supplements,--recommends. It's giving family tree but make it packages ๐ณ--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 you can change by using--verbose) ๐--nvrโ show found packages in the name-version-release format. Same as--qf "%{name}-%{version}-%{release}"๐--nevraโ show found packages in the name-epoch:version-release.architecture format. Same as--qf "%{name}-%{epoch}:%{version}-%{release}.%{arch}". This one's the default, bestie ๐--envraโ show found packages in the epoch:name-version-release.architecture format. Same as--qf "%{epoch}:%{name}-%{version}-%{release}.%{arch}"โจ--qf <format>,--queryformat <format>โ custom display format, your own little art project ๐จ<format>is the string that gets output for each matched package, and every occurrence of%{<tag>}inside it gets replaced by the corresponding attribute of the package. Wanna see the list of recognized tags? Rundnf repoquery --querytagsand slay ๐ฅ--recursiveโ query packages recursively. Has to be used with--whatrequires <REQ>(optionally with--alldeps, but not with--exactdeps) or with--requires <REQ> --resolve๐--resolveโ resolve capabilities to originating package(s) ๐ซถ
๐ Repoquery Examples ๐
Because sometimes you just need to see it in action, yk? ๐
dnf repoquery 'light*'
Display NEVRAs of all available packages matching light* โจ
dnf repoquery-na 'light*.noarch'
Display NEVRAs of all available packages matching name light* and architecture noarch. Note that it accepts only arguments in the "<name>.<arch>" format, so don't get creative ๐
dnf repoquery --requires lighttpd
Display requires of all lighttpd packages ๐
dnf repoquery --requires python --resolve
Display packages providing the requires of python packages ๐ฆ
dnf repoquery --source lighttpd
Display source rpm of lighttpd package ๐ฆ
dnf repoquery --file /etc/lighttpd/lighttpd.conf
Display package name that owns the given file ๐
dnf repoquery --queryformat '%{name}.%{arch} : %{reponame}' lighttpd
Display name, architecture and the containing repository of all lighttpd packages ๐ธ
dnf repoquery --whatprovides webserver
Display all available packages providing "webserver" ๐
dnf repoquery --whatprovides webserver --arch i686
Display all available packages providing "webserver" but only for "i686" architecture ๐
dnf repoquery --duplicates
Display duplicate packages ๐ฏ
dnf repoquery --disablerepo="*" --enablerepo="*-source" --arch=src --whatrequires <provide>
Display source packages that require a <provide> for a build ๐จ
๐ Repository-Packages Command ๐
Command: repository-packages
Deprecated aliases: repo-pkgs, repo-packages, repository-pkgs
Okay so this command lets you run commands on top of all the packages in the repository named <repoid> ๐ BUT โ important caveat, don't skip this โ any dependency resolution takes into account packages from all enabled repositories. So it's not a bubble, bestie. The <package-file-spec> and <package-spec> specifications further limit the candidates to only those packages matching at least one of them ๐
The info subcommand lists description and summary information about packages depending on the packages' relation to the repository. The list subcommand just prints lists of those packages. Simple as that โจ
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. Very "no surprises" of it ๐ซถ
dnf [options] repository-packages <repoid> info [--all] [<package-file-spec>...]
List all related packages ๐
dnf [options] repository-packages <repoid> info --installed [<package-file-spec>...]
List packages installed from the repository ๐
dnf [options] repository-packages <repoid> info --available [<package-file-spec>...]
List packages available in the repository but not currently installed on the system ๐ธ
okay so we're still deep in repository-packages territory, and there are so many little subcommands โ don't panic, bestie, they're all just variations on a vibe ๐
dnf [options] repository-packages <repoid> info --extras
[<package-file-specs>...]
List packages installed from the repository that are not available in any repository.
dnf [options] repository-packages <repoid> info --obsoletes
[<package-file-spec>...]
List packages in the repository that obsolete packages installed on the system.
dnf [options] repository-packages <repoid> info --recent
[<package-file-spec>...]
List packages recently added into the repository.
dnf [options] repository-packages <repoid> info --upgrades
[<package-file-spec>...]
List packages in the repository that upgrade packages installed on the system.
dnf [options] repository-packages <repoid> install [<package-spec>...]
Install packages matching <package-spec> from the repository. If <package-spec> isn't specified at all, install all packages from the repository.
dnf [options] repository-packages <repoid> list [--all]
[<package-file-spec>...]
List all related packages.
dnf [options] repository-packages <repoid> list --installed
[<package-file-spec>...]
List packages installed from the repository.
dnf [options] repository-packages <repoid> list --available
[<package-file-spec>...]
List packages available in the repository but not currently installed on the system.
dnf [options] repository-packages <repoid> list --extras
[<package-file-spec>...]
List packages installed from the repository that are not available in any repository.
dnf [options] repository-packages <repoid> list --obsoletes
[<package-file-spec>...]
List packages in the repository that obsolete packages installed on the system.
dnf [options] repository-packages <repoid> list --recent
[<package-file-spec>...]
List packages recently added into the repository.
dnf [options] repository-packages <repoid> list --upgrades
[<package-file-spec>...]
List packages in the repository that upgrade packages installed on the system.
dnf [options] repository-packages <repoid> move-to [<package-spec>...]
Reinstall all those packages that are available in the repository.
dnf [options] repository-packages <repoid> reinstall [<package-spec>...]
Run the reinstall-old subcommand. If it fails, run the move-to subcommand.
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.
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 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-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-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-spec>...]
Update all packages to the highest resolvable version available in the repository. When versions are specified in the <package-spec>, update to these versions.
dnf [options] repository-packages <repoid> upgrade-to
[<package-specs>...]
A deprecated alias for the upgrade subcommand.
๐ Search Command
Command: search Aliases: se
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
Command: shell Aliases: sh
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 configuration 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 statusenable: enable repositorydisable: disable repository
transaction [list|reset|solve|run]list: resolve and list the content of the transactionreset: reset the transactionrun: 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. Anydisable,enable, andresetmodule operations (e.g.module enable nodejs) must also be performed before any other shell transaction subcommand is used.
๐ Swap Command
Command: swap
dnf [options] swap <remove-spec> <install-spec>
Remove remove-spec and install install-spec in one transaction. Each <spec> can be either a <package-spec>, which specifies a package directly, or a @<group-spec>, which specifies an (environment) group which contains it. Automatic conflict solving is provided in DNF by the --allowerasing option that provides the functionality of the swap command automatically.
๐ข Updateinfo Command
Command: updateinfo Aliases: upif Deprecated aliases: list-updateinfo, list-security, list-sec, info-updateinfo, info-security, info-sec, summary-updateinfo
dnf [options] updateinfo [--summary|--list|--info] [<availability>]
[<spec>...]
Display information about update advisories.
Depending on the output type, DNF displays just counts of advisory types (omitted or --summary), list of advisories (--list) or detailed information (--info). The -v option extends the output. When used with --info, the information is even more detailed. When used with --list, an additional column with date of the last advisory update is added.
<availability> specifies whether advisories about newer versions of installed packages (omitted or --available), advisories about equal and older versions of installed packages (--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 advisory refers to a newer version but there is no enabled repository which contains any newer version.
Note, that --available takes 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 --with-cve or --with-bz options. When these switches are used also the output of the --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 (bugfix, enhancement, security/sec) nor a package name of an advisory matches <spec>, the advisory is not taken into account. The matching is case-sensitive and in the case of advisory IDs and package names, globbing is supported.
Output of the --summary option is affected by the autocheck_running_kernel configuration option.
โฌ๏ธ Upgrade Command
Command: upgrade Aliases: up Deprecated aliases: update, upgrade-to, update-to, localupdate
dnf [options] upgrade
Updates each package to the latest version that is both available and resolvable.
dnf [options] upgrade <package-spec>...
Updates each specified package to the latest available version. Updates dependencies as necessary. When versions are specified in the <package-spec>, update to these versions.
dnf [options] upgrade @<spec>...
Alias for the 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
Command: upgrade-minimal Aliases: up-min Deprecated aliases: update-minimal
dnf [options] upgrade-minimal
Updates each package to the nearest available version that provides a bugfix, enhancement or a fix for a security issue (security).
dnf [options] upgrade-minimal <package-spec>...
Updates each specified package to the nearest available version that provides a bugfix, enhancement or a fix for security issue (security). Updates dependencies as necessary.
โจ SPECIFYING PACKAGES โจ
okay so this is the part where we learn how to point at a package and be like "that one, bestie." ๐
A bunch of commands take a <package-spec> parameter that picks which package the operation is about. And <package-spec> gets matched against package NEVRAs, provides, and file provides โ like it's checking every single vibe of the package to find your match.
<package-file-spec> is basically the same thing except it does not do provides matching. So it only gets matched against NEVRAs and file provides. that's it, that's the whole personality.
<package-name-spec> is even more exclusive โ matched against NEVRAs only. minimal queen. ๐
๐ Globs
Package specification supports the exact same glob pattern matching that your shell does, and it uses it across all three of the things we just mentioned (NEVRAs, provides and file provides). so yeah, you can be fuzzy about it โจ
The patterns it supports are:
*โ matches any number of characters. the wildcard of the group chat.?โ matches any single character. one (1) character energy.[]โ 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. and if the first character following the[is a!or a^, then any character not enclosed is matched. chaotic but iconic.
note bestie ๐: curly brackets ({}) are not supported. you can still use them in shells that support them and let the shell do the expansion, but if they're quoted or escaped, dnf will not expand them. so likeโฆ don't expect it to magically know what you meant. ๐ญ
๐ฆ NEVRA Matching
when matching against NEVRAs, partial matching is supported โ dnf will try to match your spec against this list of NEVRA forms, in decreasing order of priority:
name-[epoch:]version-release.archname.archnamename-[epoch:]version-releasename-[epoch:]version
and ngl, name can in general contain dashes (e.g. package-with-dashes), so don't let the dashes jump-scare you. ๐
the first form that matches any packages is used, and the remaining forms are not tried. periodt. but if none of the forms match any packages, an attempt is made to match the <package-spec> against full package NEVRAs โ and this is only relevant if globs are present in the <package-spec>.
<package-spec> matches NEVRAs the same way <package-name-spec> does, but if matching NEVRAs fails, it also attempts to match against provides and file provides of packages. it's giving "I have a backup plan" ๐
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). BUT โ in that case you need to write the spec to match against full package NEVRAs, because it is not possible to split such a spec into NEVRA forms. the rules are the rules bestie ๐คทโโ๏ธ
๐ Specifying NEVRA Matching Explicitly
some commands (autoremove, install, remove and repoquery) also have aliases with suffixes -n, -na and -nevra that let you explicitly say how to parse the arguments. be direct! communicate! ๐
- Command
install-nonly matches against name. - Command
install-naonly matches againstname.arch. - Command
install-nevraonly matches againstname-[epoch:]version-release.arch.
๐ SPECIFYING PROVIDES ๐
<provide-spec> in command descriptions means the command operates on packages providing the given spec. this can be an explicit provide, an implicit provide (i.e. the name of the package) or a file provide. the selection is case-sensitive and globbing is supported. lowercase girlies stay winning ๐ซถ
๐ธ Specifying File Provides
if a spec starts with either / or */, it's considered a potential file provide. that's the whole rule, slay.
โญ SPECIFYING GROUPS โญ
<group-spec> lets you select (environment) groups that a particular operation should work on. it's a case insensitive string (supporting globbing characters) that gets matched against a group's ID, canonical name, and name translated into the current LC_MESSAGES locale (if possible). multilingual icon behavior ๐
๐ง SPECIFYING MODULES ๐ง
<module-spec> lets you select modules or profiles that a particular operation should work on. it's in the form of NAME:STREAM:VERSION:CONTEXT:ARCH/PROFILE and the supported partial forms are:
NAMENAME:STREAMNAME:STREAM:VERSIONNAME:STREAM:VERSION:CONTEXT- all above combinations with
::ARCH(e.g.NAME::ARCH) NAME:STREAM:VERSION:CONTEXT:ARCH- all above combinations with
/PROFILE(e.g.NAME/PROFILE)
in case stream is not specified, the enabled or the default stream is used, in this order. and in case profile is not specified, the system default profile or the 'default' profile is used. defaults will always come through for you ๐
๐ฅ SPECIFYING TRANSACTIONS ๐ฅ
<transaction-spec> can be in one of several forms. if it's an integer, it specifies a transaction ID. specifying last is the same as specifying the ID of the most recent transaction. the last form is last-<offset>, where <offset> is a positive integer โ it specifies the offset-th transaction preceding the most recent transaction. history but make it math ๐
๐ PACKAGE FILTERING ๐
Package filtering filters packages out of the available package set, making them invisible to most dnf commands. they cannot be used in a transaction. so they're not blocked, they're justโฆ not invited to the party ๐ 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. it 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. and 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:
dnf --disableexcludes=all --disableplugin="*" install bash
๐ธ Modular Filtering
please see the modularity documentation for details on how Modular Filtering works. (go read it, bestie, it's giving homework but make it lore.)
with modularity, only RPM packages from active module streams are included in the available package set. RPM packages from inactive module streams โ as well as non-modular packages with the same name or provides as a package from an active module stream โ are filtered out. modular filtering is not applied to packages added from the command line, installed packages, or packages from repositories with module_hotfixes=true in their .repo file.
โ ๏ธ disabling of modular filtering is not recommended, because it could cause the system to get into a broken state. like, actually broken. ๐ญ to disable modular filtering for a particular repository, specifymodule_hotfixes=truein the.repofile or use--setopt=<repo_id>.module_hotfixes=true.
and to discover the module which contains an excluded package, use dnf module provides. detective mode activated ๐
โญ 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. so, like, we gotta be chill about it.
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. and it is crucial that repository providers set the option well โ namely to a value where it's 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. that's the contract, bestie, honor it ๐ค
to further reduce the bandwidth load, some of the commands where having up-to-date metadata is not critical (e.g. the list command) do not look at whether a repository is expired, and whenever any version of it is locally available to the user's account, it will be used. for non-root use, see also the --cacheonly switch. and note that in all situations the user can force synchronization of all enabled repositories with the --refresh switch. you always have the power ๐
โจ
๐ 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 an additional suffix to the origin name. which file should maintain the true name after the transaction is not controlled by the package manager but is specified by each package itself, following the packaging guideline. so don't come for dnf about it, okay? it's not their call ๐
๐ฆ FILES ๐ฆ
- Cache Files โ
/var/cache/dnf - Main Configuration โ
/etc/dnf/dnf.conf - Repository โ
/etc/yum.repos.d/
๐ SEE ALSO ๐
dnf.conf(5), DNF Configuration Referencednf-PLUGIN(8)for documentation on DNF plugins.dnf.modularity(7), Modularity overview.dnf-transaction-json(5), Stored Transaction JSON Format Specification.- 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 the DNF source distribution. (go stan them, they wrote this ๐)
โญ COPYRIGHT โญ
2012-2020, Red Hat, Licensed under GPLv2+
and that's a wrap on the whole page, bestie!! ๐ you officially read an entire manpage, main character energy fr fr. this one's version 4.23.0, dated Mar 19, 2025 โ so like, write that down if you're citing it, iykyk ๐ซถโจ๐
๐ฆ where this page comes from
- opensuse-leap 16.0: yum 4.23.0-bp160.1.7 ยท GPL-2.0-only AND GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms