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