1DNF(8) DNF DNF(8)
2
3
4
6 dnf - DNF Command Reference
7
9 dnf [options] <command> [<args>...]
10
12 DNF is the next upcoming major version of YUM, a package manager for
13 RPM-based Linux distributions. It roughly maintains CLI compatibility
14 with YUM and defines a strict API for extensions and plugins.
15
16 Plugins can modify or extend features of DNF or provide additional CLI
17 commands on top of those mentioned below. If you know the name of such
18 a command (including commands mentioned below), you may find/install
19 the package which provides it using the appropriate virtual provide in
20 the form of dnf-command(<alias>), where <alias> is the name of the com‐
21 mand; e.g.``dnf install 'dnf-command(versionlock)'`` installs a ver‐
22 sionlock plugin. This approach also applies to specifying dependencies
23 of packages that require a particular DNF command.
24
25 Return values:
26
27 • 0 : Operation was successful.
28
29 • 1 : An error occurred, which was handled by dnf.
30
31 • 3 : An unknown unhandled error occurred during operation.
32
33 • 100: See check-update
34
35 • 200: There was a problem with acquiring or releasing of locks.
36
37 Available commands:
38
39 • alias
40
41 • autoremove
42
43 • check
44
45 • check-update
46
47 • clean
48
49 • deplist
50
51 • distro-sync
52
53 • downgrade
54
55 • group
56
57 • help
58
59 • history
60
61 • info
62
63 • install
64
65 • list
66
67 • makecache
68
69 • mark
70
71 • module
72
73 • provides
74
75 • reinstall
76
77 • remove
78
79 • repoinfo
80
81 • repolist
82
83 • repoquery
84
85 • repository-packages
86
87 • search
88
89 • shell
90
91 • swap
92
93 • updateinfo
94
95 • upgrade
96
97 • upgrade-minimal
98
99 Additional information:
100
101 • Options
102
103 • Specifying Packages
104
105 • Specifying Provides
106
107 • Specifying File Provides
108
109 • Specifying Groups
110
111 • Specifying Transactions
112
113 • Metadata Synchronization
114
115 • Configuration Files Replacement Policy
116
117 • Files
118
119 • See Also
120
122 -4 Resolve to IPv4 addresses only.
123
124 -6 Resolve to IPv6 addresses only.
125
126 --advisory=<advisory>, --advisories=<advisory>
127 Include packages corresponding to the advisory ID, Eg. FE‐
128 DORA-2201-123. Applicable for the install, repoquery, update‐
129 info and upgrade commands.
130
131 --allowerasing
132 Allow erasing of installed packages to resolve dependencies.
133 This option could be used as an alternative to the yum swap com‐
134 mand where packages to remove are not explicitly defined.
135
136 --assumeno
137 Automatically answer no for all questions.
138
139 -b, --best
140 Try the best available package versions in transactions. Specif‐
141 ically during dnf upgrade, which by default skips over updates
142 that can not be installed for dependency reasons, the switch
143 forces DNF to only consider the latest packages. When running
144 into packages with broken dependencies, DNF will fail giving a
145 reason why the latest version can not be installed.
146
147 Note that the use of the newest available version is only guar‐
148 anteed for the packages directly requested (e.g. as a command
149 line arguments), and the solver may use older versions of depen‐
150 dencies to meet their requirements.
151
152 --bugfix
153 Include packages that fix a bugfix issue. Applicable for the in‐
154 stall, repoquery, updateinfo and upgrade commands.
155
156 --bz=<bugzilla>, --bzs=<bugzilla>
157 Include packages that fix a Bugzilla ID, Eg. 123123. Applicable
158 for the install, repoquery, updateinfo and upgrade commands.
159
160 -C, --cacheonly
161 Run entirely from system cache, don't update the cache and use
162 it even in case it is expired.
163
164 DNF uses a separate cache for each user under which it executes.
165 The cache for the root user is called the system cache. This
166 switch allows a regular user read-only access to the system
167 cache, which usually is more fresh than the user's and thus he
168 does not have to wait for metadata sync.
169
170 --color=<color>
171 Control whether color is used in terminal output. Valid values
172 are always, never and auto (default).
173
174 --comment=<comment>
175 Add a comment to the transaction history.
176
177 -c <config file>, --config=<config file>
178 Configuration file location.
179
180 --cve=<cves>, --cves=<cves>
181 Include packages that fix a CVE (Common Vulnerabilities and Ex‐
182 posures) ID (http://cve.mitre.org/about/), Eg. CVE-2201-0123.
183 Applicable for the install, repoquery, updateinfo, and upgrade
184 commands.
185
186 -d <debug level>, --debuglevel=<debug level>
187 Debugging output level. This is an integer value between 0 (no
188 additional information strings) and 10 (shows all debugging in‐
189 formation, even that not understandable to the user), default is
190 2. Deprecated, use -v instead.
191
192 --debugsolver
193 Dump data aiding in dependency solver debugging into ./debug‐
194 data.
195
196 --disableexcludes=[all|main|<repoid>], --disableexcludep‐
197 kgs=[all|main|<repoid>]
198 Disable the configuration file excludes. Takes one of the following
199 three options:
200
201 • all, disables all configuration file excludes
202
203 • main, disables excludes defined in the [main] section
204
205 • repoid, disables excludes defined for the given repository
206
207 --disable, --set-disabled
208 Disable specified repositories (automatically saves). The option
209 has to be used together with the config-manager command
210 (dnf-plugins-core).
211
212 --disableplugin=<plugin names>
213 Disable the listed plugins specified by names or globs.
214
215 --disablerepo=<repoid>
216 Disable specific repositories by an id or a glob. This option is
217 mutually exclusive with --repo.
218
219 --downloaddir=<path>, --destdir=<path>
220 Redirect downloaded packages to provided directory. The option
221 has to be used together with the --downloadonly command line op‐
222 tion, with the download command (dnf-plugins-core) or with the
223 system-upgrade command (dnf-plugins-extras).
224
225 --downloadonly
226 Download the resolved package set without performing any rpm
227 transaction (install/upgrade/erase).
228
229 -e <error level>, --errorlevel=<error level>
230 Error output level. This is an integer value between 0 (no error
231 output) and 10 (shows all error messages), default is 3. Depre‐
232 cated, use -v instead.
233
234 --enable, --set-enabled
235 Enable specified repositories (automatically saves). The option
236 has to be used together with the config-manager command
237 (dnf-plugins-core).
238
239 --enableplugin=<plugin names>
240 Enable the listed plugins specified by names or globs.
241
242 --enablerepo=<repoid>
243 Enable additional repositories by an id or a glob.
244
245 --enhancement
246 Include enhancement relevant packages. Applicable for the in‐
247 stall, repoquery, updateinfo and upgrade commands.
248
249 -x <package-file-spec>, --exclude=<package-file-spec>
250 Exclude packages specified by <package-file-spec> from the oper‐
251 ation.
252
253 --excludepkgs=<package-file-spec>
254 Deprecated option. It was replaced by the --exclude option.
255
256 --forcearch=<arch>
257 Force the use of an architecture. Any architecture can be speci‐
258 fied. However, use of an architecture not supported natively by
259 your CPU will require emulation of some kind. This is usually
260 through QEMU. The behavior of --forcearch can be configured by
261 using the arch and ignorearch configuration options with values
262 <arch> and True respectively.
263
264 -h, --help, --help-cmd
265 Show the help.
266
267 --installroot=<path>
268 Specifies an alternative installroot, relative to where all
269 packages will be installed. Think of this like doing chroot
270 <root> dnf, except using --installroot allows dnf to work before
271 the chroot is created. It requires absolute path.
272
273 • cachedir, log files, releasever, and gpgkey are taken from or stored
274 in the installroot. Gpgkeys are imported into the installroot from a
275 path relative to the host which can be specified in the repository
276 section of configuration files.
277
278 • configuration file and reposdir are searched inside the installroot
279 first. If they are not present, they are taken from the host system.
280 Note: When a path is specified within a command line argument
281 (--config=<config file> in case of configuration file and --se‐
282 topt=reposdir=<reposdir> for reposdir) then this path is always rela‐
283 tive to the host with no exceptions.
284
285 • vars are taken from the host system or installroot according to re‐
286 posdir . When reposdir path is specified within a command line argu‐
287 ment, vars are taken from the installroot. When varsdir paths are
288 specified within a command line argument (--setopt=varsdir=<repos‐
289 dir>) then those path are always relative to the host with no excep‐
290 tions.
291
292 • The pluginpath and pluginconfpath are relative to the host.
293 Note: You may also want to use the command-line option --relea‐
294 sever=<release> when creating the installroot, otherwise the $relea‐
295 sever value is taken from the rpmdb within the installroot (and thus
296 it is empty at the time of creation and the transaction will fail).
297 If --releasever=/ is used, the releasever will be detected from the
298 host (/) system. The new installroot path at the time of creation
299 does not contain the repository, releasever and dnf.conf files.
300
301 On a modular system you may also want to use the --setopt=mod‐
302 ule_platform_id=<module_platform_name:stream> command-line option
303 when creating the installroot, otherwise the module_platform_id
304 value will be taken from the /etc/os-release file within the in‐
305 stallroot (and thus it will be empty at the time of creation, the
306 modular dependency could be unsatisfied and modules content could be
307 excluded).
308
309 Installroot examples:
310
311 dnf --installroot=<installroot> --releasever=<release> install sys‐
312 tem-release
313 Permanently sets the releasever of the system in the <in‐
314 stallroot> directory to <release>.
315
316 dnf --installroot=<installroot> --setopt=reposdir=<path> --config
317 /path/dnf.conf upgrade
318 Upgrades packages inside the installroot from a repository
319 described by --setopt using configuration from
320 /path/dnf.conf.
321
322 --newpackage
323 Include newpackage relevant packages. Applicable for the in‐
324 stall, repoquery, updateinfo and upgrade commands.
325
326 --noautoremove
327 Disable removal of dependencies that are no longer used. It sets
328 clean_requirements_on_remove configuration option to False.
329
330 --nobest
331 Set best option to False, so that transactions are not limited
332 to best candidates only.
333
334 --nodocs
335 Do not install documentation. Sets the rpm flag 'RPM‐
336 TRANS_FLAG_NODOCS'.
337
338 --nogpgcheck
339 Skip checking GPG signatures on packages (if RPM policy allows).
340
341 --noplugins
342 Disable all plugins.
343
344 --obsoletes
345 This option has an effect on an install/update, it enables dnf's
346 obsoletes processing logic. For more information see the obso‐
347 letes option.
348
349 This option also displays capabilities that the package obso‐
350 letes when used together with the repoquery command.
351
352 Configuration Option: obsoletes
353
354 -q, --quiet
355 In combination with a non-interactive command, shows just the
356 relevant content. Suppresses messages notifying about the cur‐
357 rent state or actions of DNF.
358
359 -R <minutes>, --randomwait=<minutes>
360 Maximum command wait time.
361
362 --refresh
363 Set metadata as expired before running the command.
364
365 --releasever=<release>
366 Configure DNF as if the distribution release was <release>. This
367 can affect cache paths, values in configuration files and mir‐
368 rorlist URLs.
369
370 --repofrompath <repo>,<path/url>
371 Specify a repository to add to the repositories for this query.
372 This option can be used multiple times.
373
374 • The repository label is specified by <repo>.
375
376 • The path or url to the repository is specified by <path/url>. It is
377 the same path as a baseurl and can be also enriched by the repo vari‐
378 ables.
379
380 • The configuration for the repository can be adjusted using -‐
381 -setopt=<repo>.<option>=<value>.
382
383 • If you want to view only packages from this repository, combine this
384 with the --repo=<repo> or --disablerepo="*" switches.
385
386 --repo=<repoid>, --repoid=<repoid>
387 Enable just specific repositories by an id or a glob. Can be
388 used multiple times with accumulative effect. It is basically a
389 shortcut for --disablerepo="*" --enablerepo=<repoid> and is mu‐
390 tually exclusive with the --disablerepo option.
391
392 --rpmverbosity=<name>
393 RPM debug scriptlet output level. Sets the debug level to <name>
394 for RPM scriptlets. For available levels, see the rpmverbosity
395 configuration option.
396
397 --sec-severity=<severity>, --secseverity=<severity>
398 Includes packages that provide a fix for an issue of the speci‐
399 fied severity. Applicable for the install, repoquery, update‐
400 info and upgrade commands.
401
402 --security
403 Includes packages that provide a fix for a security issue. Ap‐
404 plicable for the upgrade command.
405
406 --setopt=<option>=<value>
407 Override a configuration option from the configuration file. To
408 override configuration options for repositories, use repoid.op‐
409 tion for the <option>. Values for configuration options like ex‐
410 cludepkgs, includepkgs, installonlypkgs and tsflags are appended
411 to the original value, they do not override it. However, speci‐
412 fying an empty value (e.g. --setopt=tsflags=) will clear the op‐
413 tion.
414
415 --skip-broken
416 Resolve depsolve problems by removing packages that are causing
417 problems from the transaction. It is an alias for the strict
418 configuration option with value False. Additionally, with the
419 enable and disable module subcommands it allows one to perform
420 an action even in case of broken modular dependencies.
421
422 --showduplicates
423 Show duplicate packages in repositories. Applicable for the list
424 and search commands.
425
426 -v, --verbose
427 Verbose operation, show debug messages.
428
429 --version
430 Show DNF version and exit.
431
432 -y, --assumeyes
433 Automatically answer yes for all questions.
434
435 List options are comma-separated. Command-line options override respec‐
436 tive settings from configuration files.
437
439 For an explanation of <package-spec>, <package-file-spec> and <pack‐
440 age-name-spec> see Specifying Packages.
441
442 For an explanation of <provide-spec> see Specifying Provides.
443
444 For an explanation of <group-spec> see Specifying Groups.
445
446 For an explanation of <module-spec> see Specifying Modules.
447
448 For an explanation of <transaction-spec> see Specifying Transactions.
449
450 Alias Command
451 Command: alias
452
453
454 Allows the user to define and manage a list of aliases (in the form
455 <name=value>), which can be then used as dnf commands to abbreviate
456 longer command sequences. For examples on using the alias command, see
457 Alias Examples. For examples on the alias processing, see Alias Pro‐
458 cessing Examples.
459
460 To use an alias (name=value), the name must be placed as the first
461 "command" (e.g. the first argument that is not an option). It is then
462 replaced by its value and the resulting sequence is again searched for
463 aliases. The alias processing stops when the first found command is not
464 a name of any alias.
465
466 In case the processing would result in an infinite recursion, the orig‐
467 inal arguments are used instead.
468
469 Also, like in shell aliases, if the result starts with a \, the alias
470 processing will stop.
471
472 All aliases are defined in configuration files in the
473 /etc/dnf/aliases.d/ directory in the [aliases] section, and aliases
474 created by the alias command are written to the USER.conf file. In case
475 of conflicts, the USER.conf has the highest priority, and alphabetical
476 ordering is used for the rest of the configuration files.
477
478 Optionally, there is the enabled option in the [main] section default‐
479 ing to True. This can be set for each file separately in the respective
480 file, or globally for all aliases in the ALIASES.conf file.
481
482 dnf alias [options] [list] [<name>...]
483 List aliases with their final result. The [<alias>...] parameter
484 further limits the result to only those aliases matching it.
485
486 dnf alias [options] add <name=value>...
487 Create new aliases.
488
489 dnf alias [options] delete <name>...
490 Delete aliases.
491
492 Alias Examples
493 dnf alias list
494 Lists all defined aliases.
495
496 dnf alias add rm=remove
497 Adds a new command alias called rm which works the same as the
498 remove command.
499
500 dnf alias add upgrade="\upgrade --skip-broken --disableexcludes=all
501 --obsoletes"
502 Adds a new command alias called upgrade which works the same as
503 the upgrade command, with additional options. Note that the
504 original upgrade command is prefixed with a \ to prevent an in‐
505 finite loop in alias processing.
506
507 Alias Processing Examples
508 If there are defined aliases in=install and FORCE="--skip-broken --dis‐
509 ableexcludes=all":
510
511 • dnf FORCE in will be replaced with dnf --skip-broken --disableex‐
512 cludes=all install
513
514 • dnf in FORCE will be replaced with dnf install FORCE (which will
515 fail)
516
517 If there is defined alias in=install:
518
519 • dnf in will be replaced with dnf install
520
521 • dnf --repo updates in will be replaced with dnf --repo updates in
522 (which will fail)
523
524 Autoremove Command
525 Command: autoremove
526 Aliases for explicit NEVRA matching: autoremove-n, autoremove-na, autoremove-nevra
527
528
529 dnf [options] autoremove
530 Removes all "leaf" packages from the system that were originally in‐
531 stalled as dependencies of user-installed packages, but which are no
532 longer required by any such package.
533
534 Packages listed in installonlypkgs are never automatically removed by
535 this command.
536
537 dnf [options] autoremove <spec>...
538 This is an alias for the Remove Command command with clean_require‐
539 ments_on_remove set to True. It removes the specified packages from
540 the system along with any packages depending on the packages being
541 removed. Each <spec> can be either a <package-spec>, which specifies
542 a package directly, or a @<group-spec>, which specifies an (environ‐
543 ment) group which contains it. It also removes any dependencies that
544 are no longer needed.
545
546 There are also a few specific autoremove commands autoremove-n, au‐
547 toremove-na and autoremove-nevra that allow the specification of an
548 exact argument in the NEVRA (name-epoch:version-release.architec‐
549 ture) format.
550
551 This command by default does not force a sync of expired metadata. See
552 also Metadata Synchronization.
553
554 Check Command
555 Command: check
556
557
558 dnf [options] check [--dependencies] [--duplicates] [--obsoleted]
559 [--provides]
560 Checks the local packagedb and produces information on any problems
561 it finds. You can limit the checks to be performed by using the
562 --dependencies, --duplicates, --obsoleted and --provides options
563 (the default is to check everything).
564
565 Check-Update Command
566 Command: check-update
567 Aliases: check-upgrade
568
569
570 dnf [options] check-update [--changelogs] [<package-file-spec>...]
571 Non-interactively checks if updates of the specified packages are
572 available. If no <package-file-spec> is given, checks whether any
573 updates at all are available for your system. DNF exit code will be
574 100 when there are updates available and a list of the updates will
575 be printed, 0 if not and 1 if an error occurs. If --changelogs op‐
576 tion is specified, also changelog delta of packages about to be up‐
577 dated is printed.
578
579 Please note that having a specific newer version available for an
580 installed package (and reported by check-update) does not imply that
581 subsequent dnf upgrade will install it. The difference is that dnf
582 upgrade has restrictions (like package dependencies being satisfied)
583 to take into account.
584
585 The output is affected by the autocheck_running_kernel configuration
586 option.
587
588 Clean Command
589 Command: clean
590
591
592 Performs cleanup of temporary files kept for repositories. This in‐
593 cludes any such data left behind from disabled or removed repositories
594 as well as for different distribution release versions.
595
596 dnf clean dbcache
597 Removes cache files generated from the repository metadata. This
598 forces DNF to regenerate the cache files the next time it is
599 run.
600
601 dnf clean expire-cache
602 Marks the repository metadata expired. DNF will re-validate the
603 cache for each repository the next time it is used.
604
605 dnf clean metadata
606 Removes repository metadata. Those are the files which DNF uses
607 to determine the remote availability of packages. Using this op‐
608 tion will make DNF download all the metadata the next time it is
609 run.
610
611 dnf clean packages
612 Removes any cached packages from the system.
613
614 dnf clean all
615 Does all of the above.
616
617 Deplist Command
618 dnf [options] deplist [<select-options>] [<query-options>] [<pack‐
619 age-spec>]
620 Deprecated alias for dnf repoquery --deplist.
621
622 Distro-Sync Command
623 Command: distro-sync
624 Aliases: dsync
625 Deprecated aliases: distrosync, distribution-synchronization
626
627
628 dnf distro-sync [<package-spec>...]
629 As necessary upgrades, downgrades or keeps selected installed
630 packages to match the latest version available from any enabled
631 repository. If no package is given, all installed packages are
632 considered.
633
634 See also Configuration Files Replacement Policy.
635
636 Downgrade Command
637 Command: downgrade
638 Aliases: dg
639
640
641 dnf [options] downgrade <package-spec>...
642 Downgrades the specified packages to the highest installable
643 package of all known lower versions if possible. When version is
644 given and is lower than version of installed package then it
645 downgrades to target version.
646
647 Group Command
648 Command: group
649 Aliases: grp
650 Deprecated aliases: groups, grouplist, groupinstall, groupupdate, groupremove, grouperase, groupinfo
651
652
653 Groups are virtual collections of packages. DNF keeps track of groups
654 that the user selected ("marked") installed and can manipulate the com‐
655 prising packages with simple commands.
656
657 dnf [options] group [summary] <group-spec>
658 Display overview of how many groups are installed and available.
659 With a spec, limit the output to the matching groups. summary is
660 the default groups subcommand.
661
662 dnf [options] group info <group-spec>
663 Display package lists of a group. Shows which packages are in‐
664 stalled or available from a repository when -v is used.
665
666 dnf [options] group install [--with-optional] <group-spec>...
667 Mark the specified group installed and install packages it con‐
668 tains. Also include optional packages of the group if --with-op‐
669 tional is specified. All mandatory and Default packages will be
670 installed whenever possible. Conditional packages are installed
671 if they meet their requirement. If the group is already (par‐
672 tially) installed, the command installs the missing packages
673 from the group. Depending on the value of obsoletes configura‐
674 tion option group installation takes obsoletes into account.
675
676 dnf [options] group list <group-spec>...
677 List all matching groups, either among installed or available
678 groups. If nothing is specified, list all known groups. --in‐
679 stalled and --available options narrow down the requested list.
680 Records are ordered by the display_order tag defined in
681 comps.xml file. Provides a list of all hidden groups by using
682 option --hidden. Provides group IDs when the -v or --ids op‐
683 tions are used.
684
685 dnf [options] group remove <group-spec>...
686 Mark the group removed and remove those packages in the group
687 from the system which do not belong to another installed group
688 and were not installed explicitly by the user.
689
690 dnf [options] group upgrade <group-spec>...
691 Upgrades the packages from the group and upgrades the group it‐
692 self. The latter comprises of installing packages that were
693 added to the group by the distribution and removing packages
694 that got removed from the group as far as they were not in‐
695 stalled explicitly by the user.
696
697 Groups can also be marked installed or removed without physically ma‐
698 nipulating any packages:
699
700 dnf [options] group mark install <group-spec>...
701 Mark the specified group installed. No packages will be in‐
702 stalled by this command, but the group is then considered in‐
703 stalled.
704
705 dnf [options] group mark remove <group-spec>...
706 Mark the specified group removed. No packages will be removed by
707 this command.
708
709 See also Configuration Files Replacement Policy.
710
711 Help Command
712 Command: help
713
714
715 dnf help [<command>]
716 Displays the help text for all commands. If given a command name
717 then only displays help for that particular command.
718
719 History Command
720 Command: history
721 Aliases: hist
722
723
724 The history command allows the user to view what has happened in past
725 transactions and act according to this information (assuming the his‐
726 tory_record configuration option is set).
727
728 dnf history [list] [--reverse] [<spec>...]
729 The default history action is listing information about given
730 transactions in a table. Each <spec> can be either a <transac‐
731 tion-spec>, which specifies a transaction directly, or a <trans‐
732 action-spec>..<transaction-spec>, which specifies a range of
733 transactions, or a <package-name-spec>, which specifies a trans‐
734 action by a package which it manipulated. When no transaction is
735 specified, list all known transactions.
736
737 --reverse
738 The order of history list output is printed in reverse
739 order.
740
741 dnf history info [<spec>...]
742 Describe the given transactions. The meaning of <spec> is the
743 same as in the History List Command. When no transaction is
744 specified, describe what happened during the latest transaction.
745
746 dnf history redo <transaction-spec>|<package-file-spec>
747 Repeat the specified transaction. Uses the last transaction
748 (with the highest ID) if more than one transaction for given
749 <package-file-spec> is found. If it is not possible to redo some
750 operations due to the current state of RPMDB, it will not redo
751 the transaction.
752
753 dnf history replay [--ignore-installed] [--ignore-extras] [--skip-un‐
754 available] <filename>
755 Replay a transaction stored in file <filename> by History Store
756 Command. The replay will perform the exact same operations on
757 the packages as in the original transaction and will return with
758 an error if case of any differences in installed packages or
759 their versions. See also the Transaction JSON Format specifica‐
760 tion of the file format.
761
762 --ignore-installed
763 Don't check for the installed packages being in the same
764 state as those recorded in the transaction. E.g. in case
765 there is an upgrade foo-1.0 -> foo-2.0 stored in the
766 transaction, but there is foo-1.1 installed on the target
767 system.
768
769 --ignore-extras
770 Don't check for extra packages pulled into the transac‐
771 tion on the target system. E.g. the target system may not
772 have some dependency, which was installed on the source
773 system. The replay errors out on this by default, as the
774 transaction would not be the same.
775
776 --skip-unavailable
777 In case some packages stored in the transaction are not
778 available on the target system, skip them instead of er‐
779 roring out.
780
781 dnf history rollback <transaction-spec>|<package-file-spec>
782 Undo all transactions performed after the specified transaction.
783 Uses the last transaction (with the highest ID) if more than one
784 transaction for given <package-file-spec> is found. If it is
785 not possible to undo some transactions due to the current state
786 of RPMDB, it will not undo any transaction.
787
788 dnf history store [--output <output-file>] <transaction-spec>
789 Store a transaction specified by <transaction-spec>. The trans‐
790 action can later be replayed by the History Replay Command.
791
792 Warning: The stored transaction format is considered unstable
793 and may change at any time. It will work if the same version of
794 dnf is used to store and replay (or between versions as long as
795 it stays the same).
796
797 -o <output-file>, --output=<output-file> Store the serialized
798 transaction into <output-file. Default is transaction.json.
799
800 dnf history undo <transaction-spec>|<package-file-spec>
801 Perform the opposite operation to all operations performed in
802 the specified transaction. Uses the last transaction (with the
803 highest ID) if more than one transaction for given <pack‐
804 age-file-spec> is found. If it is not possible to undo some op‐
805 erations due to the current state of RPMDB, it will not undo the
806 transaction.
807
808 dnf history userinstalled
809 Show all installonly packages, packages installed outside of DNF
810 and packages not installed as dependency. I.e. it lists packages
811 that will stay on the system when Autoremove Command or Remove
812 Command along with clean_requirements_on_remove configuration
813 option set to True is executed. Note the same results can be ac‐
814 complished with dnf repoquery --userinstalled, and the repoquery
815 command is more powerful in formatting of the output.
816
817 This command by default does not force a sync of expired metadata, ex‐
818 cept for the redo, rollback, and undo subcommands. See also Metadata
819 Synchronization and Configuration Files Replacement Policy.
820
821 Info Command
822 Command: info
823 Aliases: if
824
825
826 dnf [options] info [<package-file-spec>...]
827 Lists description and summary information about installed and
828 available packages.
829
830 The info command limits the displayed packages the same way as the list
831 command.
832
833 This command by default does not force a sync of expired metadata. See
834 also Metadata Synchronization.
835
836 Install Command
837 Command: install
838 Aliases: in
839 Aliases for explicit NEVRA matching: install-n, install-na, install-nevra
840 Deprecated aliases: localinstall
841
842
843 dnf [options] install <spec>...
844 Makes sure that the given packages and their dependencies are
845 installed on the system. Each <spec> can be either a
846 <package-spec>, or a @<module-spec>, or a @<group-spec>. See
847 Install Examples. If a given package or provide cannot be (and
848 is not already) installed, the exit code will be non-zero. If
849 the <spec> matches both a @<module-spec> and a @<group-spec>,
850 only the module is installed.
851
852 When <package-spec> to specify the exact version of the package
853 is given, DNF will install the desired version, no matter which
854 version of the package is already installed. The former version
855 of the package will be removed in the case of non-installonly
856 package.
857
858 On the other hand if <package-spec> specifies only a name, DNF
859 also takes into account packages obsoleting it when picking
860 which package to install. This behaviour is specific to the in‐
861 stall command. Note that this can lead to seemingly unexpected
862 results if a package has multiple versions and some older ver‐
863 sion is being obsoleted. It creates a split in the upgrade-path
864 and both ways are considered correct, the resulting package is
865 picked simply by lexicographical order.
866
867 There are also a few specific install commands install-n, in‐
868 stall-na and install-nevra that allow the specification of an
869 exact argument in the NEVRA format.
870
871 See also Configuration Files Replacement Policy.
872
873 Install Examples
874 dnf install tito
875 Install the tito package (tito is the package name).
876
877 dnf install ~/Downloads/tito-0.6.2-1.fc22.noarch.rpm
878 Install a local rpm file tito-0.6.2-1.fc22.noarch.rpm from the
879 ~/Downloads/ directory.
880
881 dnf install tito-0.5.6-1.fc22
882 Install the package with a specific version. If the package is
883 already installed it will automatically try to downgrade or up‐
884 grade to the specific version.
885
886 dnf --best install tito
887 Install the latest available version of the package. If the
888 package is already installed it will try to automatically up‐
889 grade to the latest version. If the latest version of the pack‐
890 age cannot be installed, the installation will fail.
891
892 dnf install vim
893 DNF will automatically recognize that vim is not a package name,
894 but will look up and install a package that provides vim with
895 all the required dependencies. Note: Package name match has
896 precedence over package provides match.
897
898 dnf install https://kojipkgs.fedoraproject.org//pack‐
899 ages/tito/0.6.0/1.fc22/noarch/tito-0.6.0-1.fc22.noarch.rpm
900 Install a package directly from a URL.
901
902 dnf install '@docker'
903 Install all default profiles of module 'docker' and their RPMs.
904 Module streams get enabled accordingly.
905
906 dnf install '@Web Server'
907 Install the 'Web Server' environmental group.
908
909 dnf install /usr/bin/rpmsign
910 Install a package that provides the /usr/bin/rpmsign file.
911
912 dnf -y install tito --setopt=install_weak_deps=False
913 Install the tito package (tito is the package name) without weak
914 deps. Weak deps are not required for core functionality of the
915 package, but they enhance the original package (like extended
916 documentation, plugins, additional functions, etc.).
917
918 dnf install --advisory=FEDORA-2018-b7b99fe852 \*
919 Install all packages that belong to the "FEDORA-2018-b7b99fe852"
920 advisory.
921
922 List Command
923 Command: list
924 Aliases: ls
925
926
927 Prints lists of packages depending on the packages' relation to the
928 system. A package is installed if it is present in the RPMDB, and it is
929 available if it is not installed but is present in a repository that
930 DNF knows about.
931
932 The list command also limits the displayed packages according to spe‐
933 cific criteria, e.g. to only those that update an installed package
934 (respecting the repository priority). The exclude option in the config‐
935 uration file can influence the result, but if the --disableexcludes
936 command line option is used, it ensures that all installed packages
937 will be listed.
938
939 dnf [options] list [--all] [<package-file-spec>...]
940 Lists all packages, present in the RPMDB, in a repository or
941 both.
942
943 dnf [options] list --installed [<package-file-spec>...]
944 Lists installed packages.
945
946 dnf [options] list --available [<package-file-spec>...]
947 Lists available packages.
948
949 dnf [options] list --extras [<package-file-spec>...]
950 Lists extras, that is packages installed on the system that are
951 not available in any known repository.
952
953 dnf [options] list --obsoletes [<package-file-spec>...]
954 List packages installed on the system that are obsoleted by
955 packages in any known repository.
956
957 dnf [options] list --recent [<package-file-spec>...]
958 List packages recently added into the repositories.
959
960 dnf [options] list --upgrades [<package-file-spec>...]
961 List upgrades available for the installed packages.
962
963 dnf [options] list --autoremove
964 List packages which will be removed by the dnf autoremove com‐
965 mand.
966
967 This command by default does not force a sync of expired metadata. See
968 also Metadata Synchronization.
969
970 Makecache Command
971 Command: makecache
972 Aliases: mc
973
974
975 dnf [options] makecache
976 Downloads and caches metadata for enabled repositories. Tries to
977 avoid downloading whenever possible (e.g. when the local meta‐
978 data hasn't expired yet or when the metadata timestamp hasn't
979 changed).
980
981 dnf [options] makecache --timer
982 Like plain makecache, but instructs DNF to be more re‐
983 source-aware, meaning it will not do anything if running on bat‐
984 tery power and will terminate immediately if it's too soon after
985 the last successful makecache run (see dnf.conf(5), meta‐
986 data_timer_sync).
987
988 Mark Command
989 Command: mark
990
991
992 dnf mark install <package-spec>...
993 Marks the specified packages as installed by user. This can be
994 useful if any package was installed as a dependency and is de‐
995 sired to stay on the system when Autoremove Command or Remove
996 Command along with clean_requirements_on_remove configuration
997 option set to True is executed.
998
999 dnf mark remove <package-spec>...
1000 Unmarks the specified packages as installed by user. Whenever
1001 you as a user don't need a specific package you can mark it for
1002 removal. The package stays installed on the system but will be
1003 removed when Autoremove Command or Remove Command along with
1004 clean_requirements_on_remove configuration option set to True is
1005 executed. You should use this operation instead of Remove Com‐
1006 mand if you're not sure whether the package is a requirement of
1007 other user installed packages on the system.
1008
1009 dnf mark group <package-spec>...
1010 Marks the specified packages as installed by group. This can be
1011 useful if any package was installed as a dependency or a user
1012 and is desired to be protected and handled as a group member
1013 like during group remove.
1014
1015 Module Command
1016 Command: module
1017
1018
1019 Modularity overview is available at man page dnf.modularity(7). Module
1020 subcommands take <module-spec>... arguments that specify modules or
1021 profiles.
1022
1023 dnf [options] module install <module-spec>...
1024 Install module profiles, including their packages. In case no
1025 profile was provided, all default profiles get installed. Mod‐
1026 ule streams get enabled accordingly.
1027
1028 This command cannot be used for switching module streams. Use
1029 the dnf module switch-to command for that.
1030
1031 dnf [options] module update <module-spec>...
1032 Update packages associated with an active module stream, option‐
1033 ally restricted to a profile. If the profile_name is provided,
1034 only the packages referenced by that profile will be updated.
1035
1036 dnf [options] module switch-to <module-spec>...
1037 Switch to or enable a module stream, change versions of in‐
1038 stalled packages to versions provided by the new stream, and re‐
1039 move packages from the old stream that are no longer available.
1040 It also updates installed profiles if they are available for the
1041 new stream. When a profile was provided, it installs that pro‐
1042 file and does not update any already installed profiles.
1043
1044 This command can be used as a stronger version of the dnf module
1045 enable command, which not only enables modules, but also does a
1046 distrosync to all modular packages in the enabled modules.
1047
1048 It can also be used as a stronger version of the dnf module in‐
1049 stall command, but it requires to specify profiles that are sup‐
1050 posed to be installed, because switch-to command does not use
1051 default profiles. The switch-to command doesn't only install
1052 profiles, it also makes a distrosync to all modular packages in
1053 the installed module.
1054
1055 dnf [options] module remove <module-spec>...
1056 Remove installed module profiles, including packages that were
1057 installed with the dnf module install command. Will not remove
1058 packages required by other installed module profiles or by other
1059 user-installed packages. In case no profile was provided, all
1060 installed profiles get removed.
1061
1062 dnf [options] module remove --all <module-spec>...
1063 Remove installed module profiles, including packages that were
1064 installed with the dnf module install command. With --all op‐
1065 tion it additionally removes all packages whose names are pro‐
1066 vided by specified modules. Packages required by other installed
1067 module profiles and packages whose names are also provided by
1068 any other module are not removed.
1069
1070 dnf [options] module enable <module-spec>...
1071 Enable a module stream and make the stream RPMs available in the
1072 package set.
1073
1074 Modular dependencies are resolved, dependencies checked and also
1075 recursively enabled. In case of modular dependency issue the op‐
1076 eration will be rejected. To perform the action anyway please
1077 use --skip-broken option.
1078
1079 This command cannot be used for switching module streams. Use
1080 the dnf module switch-to command for that.
1081
1082 dnf [options] module disable <module-name>...
1083 Disable a module. All related module streams will become un‐
1084 available. Consequently, all installed profiles will be removed
1085 and the module RPMs will become unavailable in the package set.
1086 In case of modular dependency issue the operation will be re‐
1087 jected. To perform the action anyway please use --skip-broken
1088 option.
1089
1090 dnf [options] module reset <module-name>...
1091 Reset module state so it's no longer enabled or disabled. Con‐
1092 sequently, all installed profiles will be removed and only RPMs
1093 from the default stream will be available in the package set.
1094
1095 dnf [options] module provides <package-name-spec>...
1096 Lists all modular packages matching <package-name-spec> from all
1097 modules (including disabled), along with the modules and streams
1098 they belong to.
1099
1100 dnf [options] module list [--all] [module_name...]
1101 Lists all module streams, their profiles and states (enabled,
1102 disabled, default).
1103
1104 dnf [options] module list --enabled [module_name...]
1105 Lists module streams that are enabled.
1106
1107 dnf [options] module list --disabled [module_name...]
1108 Lists module streams that are disabled.
1109
1110 dnf [options] module list --installed [module_name...]
1111 List module streams with installed profiles.
1112
1113 dnf [options] module info <module-spec>...
1114 Print detailed information about given module stream.
1115
1116 dnf [options] module info --profile <module-spec>...
1117 Print detailed information about given module profiles.
1118
1119 dnf [options] module repoquery <module-spec>...
1120 List all available packages belonging to selected modules.
1121
1122 dnf [options] module repoquery --available <module-spec>...
1123 List all available packages belonging to selected modules.
1124
1125 dnf [options] module repoquery --installed <module-spec>...
1126 List all installed packages with same name like packages belong‐
1127 ing to selected modules.
1128
1129 Provides Command
1130 Command: provides
1131 Aliases: prov, whatprovides, wp
1132
1133
1134 dnf [options] provides <provide-spec>
1135 Finds the packages providing the given <provide-spec>. This is
1136 useful when one knows a filename and wants to find what package
1137 (installed or not) provides this file. The <provide-spec> is
1138 gradually looked for at following locations:
1139
1140 1. The <provide-spec> is matched with all file provides of any
1141 available package:
1142
1143 $ dnf provides /usr/bin/gzip
1144 gzip-1.9-9.fc29.x86_64 : The GNU data compression program
1145 Matched from:
1146 Filename : /usr/bin/gzip
1147
1148 2. Then all provides of all available packages are searched:
1149
1150 $ dnf provides "gzip(x86-64)"
1151 gzip-1.9-9.fc29.x86_64 : The GNU data compression program
1152 Matched from:
1153 Provide : gzip(x86-64) = 1.9-9.fc29
1154
1155 3. DNF assumes that the <provide-spec> is a system command,
1156 prepends it with /usr/bin/, /usr/sbin/ prefixes (one at a
1157 time) and does the file provides search again. For legacy
1158 reasons (packages that didn't do UsrMove) also /bin and /sbin
1159 prefixes are being searched:
1160
1161 $ dnf provides zless
1162 gzip-1.9-9.fc29.x86_64 : The GNU data compression program
1163 Matched from:
1164 Filename : /usr/bin/zless
1165
1166 4. If this last step also fails, DNF returns "Error: No Matches
1167 found".
1168
1169 This command by default does not force a sync of expired meta‐
1170 data. See also Metadata Synchronization.
1171
1172 Reinstall Command
1173 Command: reinstall
1174 Aliases: rei
1175
1176
1177 dnf [options] reinstall <package-spec>...
1178 Installs the specified packages, fails if some of the packages
1179 are either not installed or not available (i.e. there is no
1180 repository where to download the same RPM).
1181
1182 Remove Command
1183 Command: remove
1184 Aliases: rm
1185 Aliases for explicit NEVRA matching: remove-n, remove-na, remove-nevra
1186 Deprecated aliases: erase, erase-n, erase-na, erase-nevra
1187
1188
1189 dnf [options] remove <package-spec>...
1190 Removes the specified packages from the system along with any
1191 packages depending on the packages being removed. Each <spec>
1192 can be either a <package-spec>, which specifies a package di‐
1193 rectly, or a @<group-spec>, which specifies an (environment)
1194 group which contains it. If clean_requirements_on_remove is en‐
1195 abled (the default), also removes any dependencies that are no
1196 longer needed.
1197
1198 dnf [options] remove --duplicates
1199 Removes older versions of duplicate packages. To ensure the in‐
1200 tegrity of the system it reinstalls the newest package. In some
1201 cases the command cannot resolve conflicts. In such cases the
1202 dnf shell command with remove --duplicates and upgrade dnf-shell
1203 sub-commands could help.
1204
1205 dnf [options] remove --oldinstallonly
1206 Removes old installonly packages, keeping only latest versions
1207 and version of running kernel.
1208
1209 There are also a few specific remove commands remove-n, re‐
1210 move-na and remove-nevra that allow the specification of an ex‐
1211 act argument in the NEVRA format.
1212
1213 Remove Examples
1214 dnf remove acpi tito
1215 Remove the acpi and tito packages.
1216
1217 dnf remove $(dnf repoquery --extras --exclude=tito,acpi)
1218 Remove packages not present in any repository, but don't remove
1219 the tito and acpi packages (they still might be removed if they
1220 depend on some of the removed packages).
1221
1222 Remove older versions of duplicated packages (an equivalent of yum's
1223 package-cleanup --cleandups):
1224
1225 dnf remove --duplicates
1226
1227 Repoinfo Command
1228 Command: repoinfo
1229
1230 An alias for the repolist command that provides more detailed infor‐
1231 mation like dnf repolist -v.
1232
1233 Repolist Command
1234 Command: repolist
1235
1236
1237 dnf [options] repolist [--enabled|--disabled|--all]
1238 Depending on the exact command lists enabled, disabled or all
1239 known repositories. Lists all enabled repositories by default.
1240 Provides more detailed information when -v option is used.
1241
1242 This command by default does not force a sync of expired metadata. See
1243 also Metadata Synchronization.
1244
1245 Repoquery Command
1246 Command: repoquery
1247 Aliases: rq
1248 Aliases for explicit NEVRA matching: repoquery-n, repoquery-na, repoquery-nevra
1249
1250
1251 dnf [options] repoquery [<select-options>] [<query-options>] [<pack‐
1252 age-file-spec>]
1253 Searches available DNF repositories for selected packages and
1254 displays the requested information about them. It is an equiva‐
1255 lent of rpm -q for remote repositories.
1256
1257 dnf [options] repoquery --groupmember <package-spec>...
1258 List groups that contain <package-spec>.
1259
1260 dnf [options] repoquery --querytags
1261 Provides the list of tags recognized by the --queryformat repo‐
1262 query option.
1263
1264 There are also a few specific repoquery commands repoquery-n,
1265 repoquery-na and repoquery-nevra that allow the specification of
1266 an exact argument in the NEVRA format (does not affect arguments
1267 of options like --whatprovides <arg>, ...).
1268
1269 Select Options
1270 Together with <package-file-spec>, control what packages are displayed
1271 in the output. If <package-file-spec> is given, limits the resulting
1272 set of packages to those matching the specification. All packages are
1273 considered if no <package-file-spec> is specified.
1274
1275 <package-file-spec>
1276 Package specification in the NEVRA format (name[-[epoch:]ver‐
1277 sion[-release]][.arch]), a package provide or a file provide.
1278 See Specifying Packages.
1279
1280 -a, --all
1281 Query all packages (for rpmquery compatibility, also a shorthand
1282 for repoquery '*' or repoquery without arguments).
1283
1284 --arch <arch>[,<arch>...], --archlist <arch>[,<arch>...]
1285 Limit the resulting set only to packages of selected architec‐
1286 tures (default is all architectures). In some cases the result
1287 is affected by the basearch of the running system, therefore to
1288 run repoquery for an arch incompatible with your system use the
1289 --forcearch=<arch> option to change the basearch.
1290
1291 --duplicates
1292 Limit the resulting set to installed duplicate packages (i.e.
1293 more package versions for the same name and architecture). In‐
1294 stallonly packages are excluded from this set.
1295
1296 --unneeded
1297 Limit the resulting set to leaves packages that were installed
1298 as dependencies so they are no longer needed. This switch lists
1299 packages that are going to be removed after executing the dnf
1300 autoremove command.
1301
1302 --available
1303 Limit the resulting set to available packages only (set by de‐
1304 fault).
1305
1306 --disable-modular-filtering
1307 Disables filtering of modular packages, so that packages of in‐
1308 active module streams are included in the result.
1309
1310 --extras
1311 Limit the resulting set to packages that are not present in any
1312 of the available repositories.
1313
1314 -f <file>, --file <file>
1315 Limit the resulting set only to the package that owns <file>.
1316
1317 --installed
1318 Limit the resulting set to installed packages only. The exclude
1319 option in the configuration file might influence the result, but
1320 if the command line option --disableexcludes is used, it en‐
1321 sures that all installed packages will be listed.
1322
1323 --installonly
1324 Limit the resulting set to installed installonly packages.
1325
1326 --latest-limit <number>
1327 Limit the resulting set to <number> of latest packages for every
1328 package name and architecture. If <number> is negative, skip
1329 <number> of latest packages. For a negative <number> use the
1330 --latest-limit=<number> syntax.
1331
1332 --recent
1333 Limit the resulting set to packages that were recently edited.
1334
1335 --repo <repoid>
1336 Limit the resulting set only to packages from a repository iden‐
1337 tified by <repoid>. Can be used multiple times with accumula‐
1338 tive effect.
1339
1340 --unsatisfied
1341 Report unsatisfied dependencies among installed packages (i.e.
1342 missing requires and and existing conflicts).
1343
1344 --upgrades
1345 Limit the resulting set to packages that provide an upgrade for
1346 some already installed package.
1347
1348 --userinstalled
1349 Limit the resulting set to packages installed by the user. The
1350 exclude option in the configuration file might influence the re‐
1351 sult, but if the command line option --disableexcludes is used,
1352 it ensures that all installed packages will be listed.
1353
1354 --whatdepends <capability>[,<capability>...]
1355 Limit the resulting set only to packages that require, enhance,
1356 recommend, suggest or supplement any of <capabilities>.
1357
1358 --whatconflicts <capability>[,<capability>...]
1359 Limit the resulting set only to packages that conflict with any
1360 of <capabilities>.
1361
1362 --whatenhances <capability>[,<capability>...]
1363 Limit the resulting set only to packages that enhance any of
1364 <capabilities>. Use --whatdepends if you want to list all de‐
1365 pending packages.
1366
1367 --whatobsoletes <capability>[,<capability>...]
1368 Limit the resulting set only to packages that obsolete any of
1369 <capabilities>.
1370
1371 --whatprovides <capability>[,<capability>...]
1372 Limit the resulting set only to packages that provide any of
1373 <capabilities>.
1374
1375 --whatrecommends <capability>[,<capability>...]
1376 Limit the resulting set only to packages that recommend any of
1377 <capabilities>. Use --whatdepends if you want to list all de‐
1378 pending packages.
1379
1380 --whatrequires <capability>[,<capability>...]
1381 Limit the resulting set only to packages that require any of
1382 <capabilities>. Use --whatdepends if you want to list all de‐
1383 pending packages.
1384
1385 --whatsuggests <capability>[,<capability>...]
1386 Limit the resulting set only to packages that suggest any of
1387 <capabilities>. Use --whatdepends if you want to list all de‐
1388 pending packages.
1389
1390 --whatsupplements <capability>[,<capability>...]
1391 Limit the resulting set only to packages that supplement any of
1392 <capabilities>. Use --whatdepends if you want to list all de‐
1393 pending packages.
1394
1395 --alldeps
1396 This option is stackable with --whatrequires or --whatdepends
1397 only. Additionally it adds all packages requiring the package
1398 features to the result set (used as default).
1399
1400 --exactdeps
1401 This option is stackable with --whatrequires or --whatdepends
1402 only. Limit the resulting set only to packages that require <ca‐
1403 pability> specified by --whatrequires.
1404
1405 --srpm Operate on the corresponding source RPM.
1406
1407 Query Options
1408 Set what information is displayed about each package.
1409
1410 The following are mutually exclusive, i.e. at most one can be speci‐
1411 fied. If no query option is given, matching packages are displayed in
1412 the standard NEVRA notation.
1413
1414 -i, --info
1415 Show detailed information about the package.
1416
1417 -l, --list
1418 Show the list of files in the package.
1419
1420 -s, --source
1421 Show the package source RPM name.
1422
1423 --changelogs
1424 Print the package changelogs.
1425
1426 --conflicts
1427 Display capabilities that the package conflicts with. Same as
1428 --qf "%{conflicts}.
1429
1430 --depends
1431 Display capabilities that the package depends on, enhances, rec‐
1432 ommends, suggests or supplements.
1433
1434 --enhances
1435 Display capabilities enhanced by the package. Same as --qf
1436 "%{enhances}"".
1437
1438 --location
1439 Show a location where the package could be downloaded from.
1440
1441 --obsoletes
1442 Display capabilities that the package obsoletes. Same as --qf
1443 "%{obsoletes}".
1444
1445 --provides
1446 Display capabilities provided by the package. Same as --qf
1447 "%{provides}".
1448
1449 --recommends
1450 Display capabilities recommended by the package. Same as --qf
1451 "%{recommends}".
1452
1453 --requires
1454 Display capabilities that the package depends on. Same as --qf
1455 "%{requires}".
1456
1457 --requires-pre
1458 Display capabilities that the package depends on for running a
1459 %pre script. Same as --qf "%{requires-pre}".
1460
1461 --suggests
1462 Display capabilities suggested by the package. Same as --qf
1463 "%{suggests}".
1464
1465 --supplements
1466 Display capabilities supplemented by the package. Same as --qf
1467 "%{supplements}".
1468
1469 --tree Display a recursive tree of packages with capabilities specified
1470 by one of the following supplementary options: --whatrequires,
1471 --requires, --conflicts, --enhances, --suggests, --provides,
1472 --supplements, --recommends.
1473
1474 --deplist
1475 Produce a list of all direct dependencies and what packages pro‐
1476 vide those dependencies for the given packages. The result only
1477 shows the newest providers (which can be changed by using --ver‐
1478 bose).
1479
1480 --nvr Show found packages in the name-version-release format. Same as
1481 --qf "%{name}-%{version}-%{release}".
1482
1483 --nevra
1484 Show found packages in the name-epoch:version-release.architec‐
1485 ture format. Same as --qf "%{name}-%{epoch}:%{version}-%{re‐
1486 lease}.%{arch}" (default).
1487
1488 --envra
1489 Show found packages in the epoch:name-version-release.architec‐
1490 ture format. Same as --qf "%{epoch}:%{name}-%{version}-%{re‐
1491 lease}.%{arch}"
1492
1493 --qf <format>, --queryformat <format>
1494 Custom display format. <format> is the string to output for each
1495 matched package. Every occurrence of %{<tag>} within is replaced
1496 by the corresponding attribute of the package. The list of rec‐
1497 ognized tags can be displayed by running dnf repoquery --query‐
1498 tags.
1499
1500 --recursive
1501 Query packages recursively. Has to be used with --whatrequires
1502 <REQ> (optionally with --alldeps, but not with --exactdeps) or
1503 with --requires <REQ> --resolve.
1504
1505 --resolve
1506 resolve capabilities to originating package(s).
1507
1508 Examples
1509 Display NEVRAs of all available packages matching light*:
1510
1511 dnf repoquery 'light*'
1512
1513 Display NEVRAs of all available packages matching name light* and ar‐
1514 chitecture noarch (accepts only arguments in the "<name>.<arch>" for‐
1515 mat):
1516
1517 dnf repoquery-na 'light*.noarch'
1518
1519 Display requires of all lighttpd packages:
1520
1521 dnf repoquery --requires lighttpd
1522
1523 Display packages providing the requires of python packages:
1524
1525 dnf repoquery --requires python --resolve
1526
1527 Display source rpm of ligttpd package:
1528
1529 dnf repoquery --source lighttpd
1530
1531 Display package name that owns the given file:
1532
1533 dnf repoquery --file /etc/lighttpd/lighttpd.conf
1534
1535 Display name, architecture and the containing repository of all
1536 lighttpd packages:
1537
1538 dnf repoquery --queryformat '%{name}.%{arch} : %{reponame}' lighttpd
1539
1540 Display all available packages providing "webserver":
1541
1542 dnf repoquery --whatprovides webserver
1543
1544 Display all available packages providing "webserver" but only for
1545 "i686" architecture:
1546
1547 dnf repoquery --whatprovides webserver --arch i686
1548
1549 Display duplicate packages:
1550
1551 dnf repoquery --duplicates
1552
1553 Display source packages that require a <provide> for a build:
1554
1555 dnf repoquery --disablerepo="*" --enablerepo="*-source" --arch=src --whatrequires <provide>
1556
1557 Repository-Packages Command
1558 Command: repository-packages
1559 Deprecated aliases: repo-pkgs, repo-packages, repository-pkgs
1560
1561
1562 The repository-packages command allows the user to run commands on top
1563 of all packages in the repository named <repoid>. However, any depen‐
1564 dency resolution takes into account packages from all enabled reposito‐
1565 ries. The <package-file-spec> and <package-spec> specifications further
1566 limit the candidates to only those packages matching at least one of
1567 them.
1568
1569 The info subcommand lists description and summary information about
1570 packages depending on the packages' relation to the repository. The
1571 list subcommand just prints lists of those packages.
1572
1573 dnf [options] repository-packages <repoid> check-update [<pack‐
1574 age-file-spec>...]
1575 Non-interactively checks if updates of the specified packages in
1576 the repository are available. DNF exit code will be 100 when
1577 there are updates available and a list of the updates will be
1578 printed.
1579
1580 dnf [options] repository-packages <repoid> info [--all] [<pack‐
1581 age-file-spec>...]
1582 List all related packages.
1583
1584 dnf [options] repository-packages <repoid> info --installed [<pack‐
1585 age-file-spec>...]
1586 List packages installed from the repository.
1587
1588 dnf [options] repository-packages <repoid> info --available [<pack‐
1589 age-file-spec>...]
1590 List packages available in the repository but not currently in‐
1591 stalled on the system.
1592
1593 dnf [options] repository-packages <repoid> info --extras [<pack‐
1594 age-file-specs>...]
1595 List packages installed from the repository that are not avail‐
1596 able in any repository.
1597
1598 dnf [options] repository-packages <repoid> info --obsoletes [<pack‐
1599 age-file-spec>...]
1600 List packages in the repository that obsolete packages installed
1601 on the system.
1602
1603 dnf [options] repository-packages <repoid> info --recent [<pack‐
1604 age-file-spec>...]
1605 List packages recently added into the repository.
1606
1607 dnf [options] repository-packages <repoid> info --upgrades [<pack‐
1608 age-file-spec>...]
1609 List packages in the repository that upgrade packages installed
1610 on the system.
1611
1612 dnf [options] repository-packages <repoid> install [<package-spec>...]
1613 Install packages matching <package-spec> from the repository. If
1614 <package-spec> isn't specified at all, install all packages from
1615 the repository.
1616
1617 dnf [options] repository-packages <repoid> list [--all] [<pack‐
1618 age-file-spec>...]
1619 List all related packages.
1620
1621 dnf [options] repository-packages <repoid> list --installed [<pack‐
1622 age-file-spec>...]
1623 List packages installed from the repository.
1624
1625 dnf [options] repository-packages <repoid> list --available [<pack‐
1626 age-file-spec>...]
1627 List packages available in the repository but not currently in‐
1628 stalled on the system.
1629
1630 dnf [options] repository-packages <repoid> list --extras [<pack‐
1631 age-file-spec>...]
1632 List packages installed from the repository that are not avail‐
1633 able in any repository.
1634
1635 dnf [options] repository-packages <repoid> list --obsoletes [<pack‐
1636 age-file-spec>...]
1637 List packages in the repository that obsolete packages installed
1638 on the system.
1639
1640 dnf [options] repository-packages <repoid> list --recent [<pack‐
1641 age-file-spec>...]
1642 List packages recently added into the repository.
1643
1644 dnf [options] repository-packages <repoid> list --upgrades [<pack‐
1645 age-file-spec>...]
1646 List packages in the repository that upgrade packages installed
1647 on the system.
1648
1649 dnf [options] repository-packages <repoid> move-to [<package-spec>...]
1650 Reinstall all those packages that are available in the reposi‐
1651 tory.
1652
1653 dnf [options] repository-packages <repoid> reinstall [<pack‐
1654 age-spec>...]
1655 Run the reinstall-old subcommand. If it fails, run the move-to
1656 subcommand.
1657
1658 dnf [options] repository-packages <repoid> reinstall-old [<pack‐
1659 age-spec>...]
1660 Reinstall all those packages that were installed from the repos‐
1661 itory and simultaneously are available in the repository.
1662
1663 dnf [options] repository-packages <repoid> remove [<package-spec>...]
1664 Remove all packages installed from the repository along with any
1665 packages depending on the packages being removed. If clean_re‐
1666 quirements_on_remove is enabled (the default) also removes any
1667 dependencies that are no longer needed.
1668
1669 dnf [options] repository-packages <repoid> remove-or-distro-sync
1670 [<package-spec>...]
1671 Select all packages installed from the repository. Upgrade,
1672 downgrade or keep those of them that are available in another
1673 repository to match the latest version available there and re‐
1674 move the others along with any packages depending on the pack‐
1675 ages being removed. If clean_requirements_on_remove is enabled
1676 (the default) also removes any dependencies that are no longer
1677 needed.
1678
1679 dnf [options] repository-packages <repoid> remove-or-reinstall [<pack‐
1680 age-spec>...]
1681 Select all packages installed from the repository. Reinstall
1682 those of them that are available in another repository and re‐
1683 move the others along with any packages depending on the pack‐
1684 ages being removed. If clean_requirements_on_remove is enabled
1685 (the default) also removes any dependencies that are no longer
1686 needed.
1687
1688 dnf [options] repository-packages <repoid> upgrade [<package-spec>...]
1689 Update all packages to the highest resolvable version available
1690 in the repository. When versions are specified in the <pack‐
1691 age-spec>, update to these versions.
1692
1693 dnf [options] repository-packages <repoid> upgrade-to [<pack‐
1694 age-specs>...]
1695 A deprecated alias for the upgrade subcommand.
1696
1697 Search Command
1698 Command: search
1699 Aliases: se
1700
1701
1702 dnf [options] search [--all] <keywords>...
1703 Search package metadata for keywords. Keywords are matched as
1704 case-insensitive substrings, globbing is supported. By default
1705 lists packages that match all requested keys (AND operation).
1706 Keys are searched in package names and summaries. If the
1707 "--all" option is used, lists packages that match at least one
1708 of the keys (an OR operation). In addition the keys are
1709 searched in the package descriptions and URLs. The result is
1710 sorted from the most relevant results to the least.
1711
1712 This command by default does not force a sync of expired metadata. See
1713 also Metadata Synchronization.
1714
1715 Shell Command
1716 Command: shell
1717 Aliases: sh
1718
1719
1720 dnf [options] shell [filename]
1721 Open an interactive shell for conducting multiple commands dur‐
1722 ing a single execution of DNF. These commands can be issued man‐
1723 ually or passed to DNF from a file. The commands are much the
1724 same as the normal DNF command line options. There are a few ad‐
1725 ditional commands documented below.
1726
1727 config [conf-option] [value]
1728
1729 • Set a configuration option to a requested value. If no
1730 value is given it prints the current value.
1731
1732 repo [list|enable|disable] [repo-id]
1733
1734 • list: list repositories and their status
1735
1736 • enable: enable repository
1737
1738 • disable: disable repository
1739
1740 transaction [list|reset|solve|run]
1741
1742 • list: resolve and list the content of the transaction
1743
1744 • reset: reset the transaction
1745
1746 • run: resolve and run the transaction
1747
1748 Note that all local packages must be used in the first shell
1749 transaction subcommand (e.g. install /tmp/nodejs-1-1.x86_64.rpm
1750 /tmp/acpi-1-1.noarch.rpm) otherwise an error will occur. Any
1751 disable, enable, and reset module operations (e.g. module enable
1752 nodejs) must also be performed before any other shell transac‐
1753 tion subcommand is used.
1754
1755 Swap Command
1756 Command: swap
1757
1758
1759 dnf [options] swap <remove-spec> <install-spec>
1760 Remove spec and install spec in one transaction. Each <spec> can be
1761 either a <package-spec>, which specifies a package directly, or a
1762 @<group-spec>, which specifies an (environment) group which contains
1763 it. Automatic conflict solving is provided in DNF by the --allow‐
1764 erasing option that provides the functionality of the swap command
1765 automatically.
1766
1767 Updateinfo Command
1768 Command: updateinfo
1769 Aliases: upif
1770 Deprecated aliases: list-updateinfo, list-security, list-sec, info-updateinfo, info-security, info-sec, summary-updateinfo
1771
1772
1773 dnf [options] updateinfo [--summary|--list|--info] [<availability>]
1774 [<spec>...]
1775 Display information about update advisories.
1776
1777 Depending on the output type, DNF displays just counts of advi‐
1778 sory types (omitted or --summary), list of advisories (--list)
1779 or detailed information (--info). The -v option extends the out‐
1780 put. When used with --info, the information is even more de‐
1781 tailed. When used with --list, an additional column with date of
1782 the last advisory update is added.
1783
1784 <availability> specifies whether advisories about newer versions
1785 of installed packages (omitted or --available), advisories about
1786 equal and older versions of installed packages (--installed),
1787 advisories about newer versions of those installed packages for
1788 which a newer version is available (--updates) or advisories
1789 about any versions of installed packages (--all) are taken into
1790 account. Most of the time, --available and --updates displays
1791 the same output. The outputs differ only in the cases when an
1792 advisory refers to a newer version but there is no enabled
1793 repository which contains any newer version.
1794
1795 Note, that --available takes only the latest installed versions
1796 of packages into account. In case of the kernel packages (when
1797 multiple version could be installed simultaneously) also pack‐
1798 ages of the currently running version of kernel are added.
1799
1800 To print only advisories referencing a CVE or a bugzilla use
1801 --with-cve or --with-bz options. When these switches are used
1802 also the output of the --list is altered - the ID of the CVE or
1803 the bugzilla is printed instead of the one of the advisory.
1804
1805 If given and if neither ID, type (bugfix, enhancement, secu‐
1806 rity/sec) nor a package name of an advisory matches <spec>, the
1807 advisory is not taken into account. The matching is case-sensi‐
1808 tive and in the case of advisory IDs and package names, globbing
1809 is supported.
1810
1811 Output of the --summary option is affected by the autocheck_run‐
1812 ning_kernel configuration option.
1813
1814 Upgrade Command
1815 Command: upgrade
1816 Aliases: up
1817 Deprecated aliases: update, upgrade-to, update-to, localupdate
1818
1819
1820 dnf [options] upgrade
1821 Updates each package to the latest version that is both avail‐
1822 able and resolvable.
1823
1824 dnf [options] upgrade <package-spec>...
1825 Updates each specified package to the latest available version.
1826 Updates dependencies as necessary. When versions are specified
1827 in the <package-spec>, update to these versions.
1828
1829 dnf [options] upgrade @<spec>...
1830 Alias for the dnf module update command.
1831
1832 If the main obsoletes configure option is true or the --obsoletes flag
1833 is present, dnf will include package obsoletes in its calculations.
1834 For more information see obsoletes.
1835
1836 See also Configuration Files Replacement Policy.
1837
1838 Upgrade-Minimal Command
1839 Command: upgrade-minimal
1840 Aliases: up-min
1841 Deprecated aliases: update-minimal
1842
1843
1844 dnf [options] upgrade-minimal
1845 Updates each package to the latest available version that pro‐
1846 vides a bugfix, enhancement or a fix for a security issue (secu‐
1847 rity).
1848
1849 dnf [options] upgrade-minimal <package-spec>...
1850 Updates each specified package to the latest available version
1851 that provides a bugfix, enhancement or a fix for security issue
1852 (security). Updates dependencies as necessary.
1853
1855 Many commands take a <package-spec> parameter that selects a package
1856 for the operation. The <package-spec> argument is matched against pack‐
1857 age NEVRAs, provides and file provides.
1858
1859 <package-file-spec> is similar to <package-spec>, except provides
1860 matching is not performed. Therefore, <package-file-spec> is matched
1861 only against NEVRAs and file provides.
1862
1863 <package-name-spec> is matched against NEVRAs only.
1864
1865 Globs
1866 Package specification supports the same glob pattern matching that
1867 shell does, in all three above mentioned packages it matches against
1868 (NEVRAs, provides and file provides).
1869
1870 The following patterns are supported:
1871
1872 * Matches any number of characters.
1873
1874 ? Matches any single character.
1875
1876 [] Matches any one of the enclosed characters. A pair of characters
1877 separated by a hyphen denotes a range expression; any character
1878 that falls between those two characters, inclusive, is matched.
1879 If the first character following the [ is a ! or a ^ then any
1880 character not enclosed is matched.
1881
1882 Note: Curly brackets ({}) are not supported. You can still use them in
1883 shells that support them and let the shell do the expansion, but if
1884 quoted or escaped, dnf will not expand them.
1885
1886 NEVRA Matching
1887 When matching against NEVRAs, partial matching is supported. DNF tries
1888 to match the spec against the following list of NEVRA forms (in de‐
1889 creasing order of priority):
1890
1891 • name-[epoch:]version-release.arch
1892
1893 • name.arch
1894
1895 • name
1896
1897 • name-[epoch:]version-release
1898
1899 • name-[epoch:]version
1900
1901 Note that name can in general contain dashes (e.g. pack‐
1902 age-with-dashes).
1903
1904 The first form that matches any packages is used and the remaining
1905 forms are not tried. If none of the forms match any packages, an at‐
1906 tempt is made to match the <package-spec> against full package NEVRAs.
1907 This is only relevant if globs are present in the <package-spec>.
1908
1909 <package-spec> matches NEVRAs the same way <package-name-spec> does,
1910 but in case matching NEVRAs fails, it attempts to match against pro‐
1911 vides and file provides of packages as well.
1912
1913 You can specify globs as part of any of the five NEVRA components. You
1914 can also specify a glob pattern to match over multiple NEVRA components
1915 (in other words, to match across the NEVRA separators). In that case,
1916 however, you need to write the spec to match against full package
1917 NEVRAs, as it is not possible to split such spec into NEVRA forms.
1918
1919 Specifying NEVRA Matching Explicitly
1920 Some commands (autoremove, install, remove and repoquery) also have
1921 aliases with suffixes -n, -na and -nevra that allow to explicitly spec‐
1922 ify how to parse the arguments:
1923
1924 • Command install-n only matches against name.
1925
1926 • Command install-na only matches against name.arch.
1927
1928 • Command install-nevra only matches against name-[epoch:]version-re‐
1929 lease.arch.
1930
1932 <provide-spec> in command descriptions means the command operates on
1933 packages providing the given spec. This can either be an explicit pro‐
1934 vide, an implicit provide (i.e. name of the package) or a file provide.
1935 The selection is case-sensitive and globbing is supported.
1936
1937 Specifying File Provides
1938 If a spec starts with either / or */, it is considered as a potential
1939 file provide.
1940
1942 <group-spec> allows one to select (environment) groups a particular op‐
1943 eration should work on. It is a case insensitive string (supporting
1944 globbing characters) that is matched against a group's ID, canonical
1945 name and name translated into the current LC_MESSAGES locale (if possi‐
1946 ble).
1947
1949 <module-spec> allows one to select modules or profiles a particular op‐
1950 eration should work on.
1951
1952 It is in the form of NAME:STREAM:VERSION:CONTEXT:ARCH/PROFILE and sup‐
1953 ported partial forms are the following:
1954
1955 • NAME
1956
1957 • NAME:STREAM
1958
1959 • NAME:STREAM:VERSION
1960
1961 • NAME:STREAM:VERSION:CONTEXT
1962
1963 • all above combinations with ::ARCH (e.g. NAME::ARCH)
1964
1965 • NAME:STREAM:VERSION:CONTEXT:ARCH
1966
1967 • all above combinations with /PROFILE (e.g. NAME/PROFILE)
1968
1969 In case stream is not specified, the enabled or the default stream is
1970 used, in this order. In case profile is not specified, the system de‐
1971 fault profile or the 'default' profile is used.
1972
1974 <transaction-spec> can be in one of several forms. If it is an integer,
1975 it specifies a transaction ID. Specifying last is the same as specify‐
1976 ing the ID of the most recent transaction. The last form is last-<off‐
1977 set>, where <offset> is a positive integer. It specifies offset-th
1978 transaction preceding the most recent transaction.
1979
1981 Package filtering filters packages out from the available package set,
1982 making them invisible to most of dnf commands. They cannot be used in a
1983 transaction. Packages can be filtered out by either Exclude Filtering
1984 or Modular Filtering.
1985
1986 Exclude Filtering
1987 Exclude Filtering is a mechanism used by a user or by a DNF plugin to
1988 modify the set of available packages. Exclude Filtering can be modified
1989 by either includepkgs or excludepkgs configuration options in configu‐
1990 ration files. The --disableexcludes command line option can be used to
1991 override excludes from configuration files. In addition to user-config‐
1992 ured excludes, plugins can also extend the set of excluded packages. To
1993 disable excludes from a DNF plugin you can use the --disableplugin com‐
1994 mand line option.
1995
1996 To disable all excludes for e.g. the install command you can use the
1997 following combination of command line options:
1998
1999 dnf --disableexcludes=all --disableplugin="*" install bash
2000
2001 Modular Filtering
2002 Please see the modularity documentation for details on how Modular Fil‐
2003 tering works.
2004
2005 With modularity, only RPM packages from active module streams are in‐
2006 cluded in the available package set. RPM packages from inactive module
2007 streams, as well as non-modular packages with the same name or provides
2008 as a package from an active module stream, are filtered out. Modular
2009 filtering is not applied to packages added from the command line, in‐
2010 stalled packages, or packages from repositories with module_hot‐
2011 fixes=true in their .repo file.
2012
2013 Disabling of modular filtering is not recommended, because it could
2014 cause the system to get into a broken state. To disable modular filter‐
2015 ing for a particular repository, specify module_hotfixes=true in the
2016 .repo file or use --setopt=<repo_id>.module_hotfixes=true.
2017
2018 To discover the module which contains an excluded package use dnf mod‐
2019 ule provides.
2020
2022 Correct operation of DNF depends on having access to up-to-date data
2023 from all enabled repositories but contacting remote mirrors on every
2024 operation considerably slows it down and costs bandwidth for both the
2025 client and the repository provider. The metadata_expire (see
2026 dnf.conf(5)) repository configuration option is used by DNF to deter‐
2027 mine whether a particular local copy of repository data is due to be
2028 re-synced. It is crucial that the repository providers set the option
2029 well, namely to a value where it is guaranteed that if particular meta‐
2030 data was available in time T on the server, then all packages it refer‐
2031 ences will still be available for download from the server in time T +
2032 metadata_expire.
2033
2034 To further reduce the bandwidth load, some of the commands where having
2035 up-to-date metadata is not critical (e.g. the list command) do not look
2036 at whether a repository is expired and whenever any version of it is
2037 locally available to the user's account, it will be used. For non-root
2038 use, see also the --cacheonly switch. Note that in all situations the
2039 user can force synchronization of all enabled repositories with the
2040 --refresh switch.
2041
2043 The updated packages could replace the old modified configuration files
2044 with the new ones or keep the older files. Neither of the files are ac‐
2045 tually replaced. To the conflicting ones RPM gives additional suffix
2046 to the origin name. Which file should maintain the true name after
2047 transaction is not controlled by package manager but is specified by
2048 each package itself, following packaging guideline.
2049
2051 Cache Files
2052 /var/cache/dnf
2053
2054 Main Configuration
2055 /etc/dnf/dnf.conf
2056
2057 Repository
2058 /etc/yum.repos.d/
2059
2061 • dnf.conf(5), DNF Configuration Reference
2062
2063 • dnf-PLUGIN(8) for documentation on DNF plugins.
2064
2065 • dnf.modularity(7), Modularity overview.
2066
2067 • dnf-transaction-json(5), Stored Transaction JSON Format Specifica‐
2068 tion.
2069
2070 • DNF project homepage (‐
2071 https://github.com/rpm-software-management/dnf/)
2072
2073 • How to report a bug (‐
2074 https://github.com/rpm-software-management/dnf/wiki/Bug-Reporting)
2075
2076 • YUM project homepage (http://yum.baseurl.org/)
2077
2079 See AUTHORS in DNF source distribution.
2080
2082 2012-2021, Red Hat, Licensed under GPLv2+
2083
2084
2085
2086
20874.9.0 Sep 23, 2021 DNF(8)