1..
2  Copyright (C) 2014-2018 Red Hat, Inc.
3
4  This copyrighted material is made available to anyone wishing to use,
5  modify, copy, or redistribute it subject to the terms and conditions of
6  the GNU General Public License v.2, or (at your option) any later version.
7  This program is distributed in the hope that it will be useful, but WITHOUT
8  ANY WARRANTY expressed or implied, including the implied warranties of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
10  Public License for more details.  You should have received a copy of the
11  GNU General Public License along with this program; if not, write to the
12  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
13  02110-1301, USA.  Any Red Hat trademarks that are incorporated in the
14  source code or documentation are not subject to the GNU General Public
15  License and may only be used or replicated with the express permission of
16  Red Hat, Inc.
17
18####################################
19 Changes in DNF CLI compared to YUM
20####################################
21
22.. only :: html
23
24    .. contents::
25
26======================
27 ``--skip-broken``
28======================
29
30For install command:
31
32The ``--skip-broken`` option is an alias for ``--setopt=strict=0``. Both options could be used
33with DNF to skip all unavailable packages or packages with broken dependencies given to DNF
34without raising an error causing the whole operation to fail. This behavior can be set as default
35in dnf.conf file. See :ref:`strict conf option <strict-label>`.
36
37For upgrade command:
38
39The semantics that were supposed to trigger in YUM with ``--skip-broken`` are now set for plain
40``dnf update`` as a default. There is no need to use ``--skip-broken`` with the ``dnf upgrade``
41command. To use only the latest versions of packages in transactions, there is the ``--best``
42command line switch.
43
44========================================
45Update and Upgrade Commands are the Same
46========================================
47
48Invoking ``dnf update`` or ``dnf upgrade``, in all their forms, has the same
49effect in DNF, with the latter being preferred. In YUM ``yum upgrade`` was
50exactly like ``yum --obsoletes update``.
51
52================================================
53 ``clean_requirements_on_remove`` on by default
54================================================
55
56The :ref:`clean_requirements_on_remove <clean_requirements_on_remove-label>`
57switch is on by default in DNF. It can thus be confusing to compare the "remove"
58operation results between DNF and YUM as by default DNF is often going to remove
59more packages.
60
61===========================
62 No ``resolvedep`` command
63===========================
64
65The YUM version of this command is maintained for legacy reasons only. The user
66can just use ``dnf provides`` to find out what package provides a particular file.
67
68===========================
69 No ``deplist`` command
70===========================
71
72An alternative to the YUM ``deplist`` command to find out dependencies of a package
73is ``dnf repoquery --deplist`` using :ref:`repoquery command
74<repoquery_command-label>`.
75
76.. note::  Alternatively there is a YUM compatibility support where
77           ``yum deplist`` is alias for ``dnf repoquery --deplist`` command
78
79====================================================
80 Excludes and repo excludes apply to all operations
81====================================================
82
83YUM only respects excludes during installs and upgrades. DNF extends this to all
84operations, among others erasing and listing. If you e.g. want to see a list of
85all installed ``python-f*`` packages but not any of the Flask packages, the
86following will work::
87
88    dnf -x '*flask*' list installed 'python-f*'
89
90=======================================
91The ``include`` option has been removed
92=======================================
93
94Inclusion of other configuration files in the main configuration file is no longer supported.
95
96====================================================
97``dnf provides /bin/<file>`` is not fully supported
98====================================================
99
100After `UsrMove <https://fedoraproject.org/wiki/Features/UsrMove>`_ there's no
101directory ``/bin`` on Fedora systems and no files get installed there,
102``/bin`` is only a symlink created by the ``filesystem`` package to point to
103``/usr/bin``. Resolving the symlinks to their real path would only give the
104user a false sense that this works, while in fact provides requests using globs
105such as::
106
107    dnf provides /b*/<file>
108
109will fail still (as they do in YUM now). To find what provides a particular
110binary, use the actual path for binaries on Fedora::
111
112    dnf provides /usr/bin/<file>
113
114Also see related Fedora bugzillas `982947
115<https://bugzilla.redhat.com/show_bug.cgi?id=982947>`_ and `982664
116<https://bugzilla.redhat.com/show_bug.cgi?id=982664>`_.
117
118.. _skip_if_unavailable_default:
119
120====================================================
121 ``skip_if_unavailable`` could be enabled by default
122====================================================
123
124In some distributions DNF is shipped with ``skip_if_unavailable=True`` in
125the :ref:`DNF configuration file <conf_ref-label>`. The reason for the change
126is that third-party repositories can often be unavailable. Without this setting
127in the relevant repository configuration file YUM immediately stops on a
128repository synchronization error, confusing and bothering the user.
129
130See the related `Fedora bug 984483 <https://bugzilla.redhat.com/show_bug.cgi?id=984483>`_.
131
132============================================================================
133 ``overwrite_groups`` dropped, comps functions acting as if always disabled
134============================================================================
135
136This config option has been dropped. When DNF sees several groups with the same
137group ID it merges the groups' contents together.
138
139===============================
140 ``mirrorlist_expire`` dropped
141===============================
142
143To simplify things for the user, DNF uses ``metadata_expire`` for both expiring
144metadata and the mirrorlist file (which is a kind of metadata itself).
145
146===========================================================
147 metalink not recognized in the ``mirrorlist`` repo option
148===========================================================
149
150The following part of ``yum.conf(5)`` no longer applies for the ``mirrorlist``
151option:
152
153    As a special hack if the mirrorlist URL contains the word "metalink" then
154    the value of mirrorlist is copied to metalink (if metalink is not set).
155
156The relevant repository configuration files have been fixed to respect this, see
157the related `Fedora bug 948788
158<https://bugzilla.redhat.com/show_bug.cgi?id=948788>`_.
159
160=================================
161 ``alwaysprompt`` dropped
162=================================
163
164Unsupported to simplify the configuration.
165
166.. _upgrade_requirements_on_install_dropped:
167
168=============================================
169 ``upgrade_requirements_on_install`` dropped
170=============================================
171
172Dropping this config option with blurry semantics simplifies the
173configuration. DNF behaves as if this was disabled. If the user wanted to
174upgrade everything to the latest version she'd simply use ``dnf upgrade``.
175
176========================================
177 ``dnf history rollback`` check dropped
178========================================
179
180Since DNF tolerates the use of other package managers, it is possible that not
181all changes to the RPMDB are stored in the history of transactions. Therefore, DNF
182does not fail if such a situation is encountered and thus the ``force`` option
183is not needed anymore.
184
185.. _allowerasing_instead_of_swap:
186
187============================================================
188 Packages replacement without ``yum swap``
189============================================================
190
191Time after time one needs to remove an installed package and replace it with a different one, providing the same capabilities while other packages depending on these capabilities stay installed. Without (transiently) breaking consistency of the package database this can be done by performing the remove and the install in one transaction. The common way to set up such a transaction in DNF is to use ``dnf shell`` or use the ``--allowerasing`` switch.
192
193E.g. say you want to replace ``A`` (providing ``P``)  with B (also providing ``P``, conflicting with ``A``) without deleting ``C`` (which requires ``P``) in the process. Use::
194
195  dnf --allowerasing install B
196
197This command is equal to ``yum swap A B``.
198
199DNF provides swap command but only ``dnf swap A B`` syntax is supported
200
201========================================================
202 Dependency processing details are not shown in the CLI
203========================================================
204
205During its depsolving phase, YUM outputs lines similar to::
206
207  ---> Package rubygem-rhc.noarch 0:1.16.9-1.fc19 will be an update
208  --> Processing Dependency: rubygem-net-ssh-multi >= 1.2.0 for package: rubygem-rhc-1.16.9-1.fc19.noarch
209
210DNF does not output information like this. The technical reason is that depsolver below DNF always considers all dependencies for update candidates and the output would be very long. Secondly, even in YUM this output gets confusing very quickly especially for large transactions and so does more harm than good.
211
212See the related `Fedora bug 1044999
213<https://bugzilla.redhat.com/show_bug.cgi?id=1044999>`_.
214
215===================================================================
216``dnf provides`` complies with the YUM documentation of the command
217===================================================================
218
219When one executes::
220
221  yum provides sandbox
222
223YUM applies extra heuristics to determine what the user meant by ``sandbox``, for instance it sequentially prepends entries from the ``PATH`` environment variable to it to see if it matches a file provided by some package. This is an undocumented behavior that DNF does not emulate. Just typically use::
224
225  dnf provides /usr/bin/sandbox
226
227or even::
228
229  dnf provides '*/sandbox'
230
231to obtain similar results.
232
233==================
234Bandwidth limiting
235==================
236
237DNF supports the ``throttle`` and ``bandwidth`` options familiar from YUM.
238Contrary to YUM, when multiple downloads run simultaneously the total
239downloading speed is throttled. This was not possible in YUM since
240downloaders ran in different processes.
241
242===================================
243 ``installonlypkgs`` config option
244===================================
245
246Compared to YUM, DNF appends list values from the ``installonlypkgs`` config option to DNF defaults, where YUM overwrites the defaults by option values.
247
248==============================
249 The usage of Delta RPM files
250==============================
251
252The boolean ``deltarpm`` option controls whether delta RPM files are used. Compared to YUM, DNF does not support ``deltarpm_percentage`` and instead chooses some optimal value of DRPM/RPM ratio to decide whether using deltarpm makes sense in the given case.
253
254================================================
255 Handling .srpm files and non-existent packages
256================================================
257
258DNF will terminate early with an error if a command is executed requesting an installing operation on a local ``.srpm`` file::
259
260  $ dnf install fdn-0.4.17-1.fc20.src.rpm tour-4-6.noarch.rpm
261  Error: Will not install a source rpm package (fdn-0.4.17-1.fc20.src).
262
263The same applies for package specifications that do not match any available package.
264
265YUM will only issue a warning in this case and continue installing the "tour" package. The rationale behind the result in DNF is that a program should terminate with an error if it can not fulfill the CLI command in its entirety.
266
267=============================================================
268 Promoting package to install to a package that obsoletes it
269=============================================================
270
271DNF will not magically replace a request for installing package ``X`` to installing package ``Y`` if ``Y`` obsoletes ``X``. YUM does this if its ``obsoletes`` config option is enabled but the behavior is not properly documented and can be harmful.
272
273See the related `Fedora bug 1096506
274<https://bugzilla.redhat.com/show_bug.cgi?id=1096506>`_ and `guidelines for renaming and obsoleting packages in Fedora <http://fedoraproject.org/wiki/Upgrade_paths_%E2%80%94_renaming_or_splitting_packages>`_.
275
276====================================
277Behavior of ``--installroot`` option
278====================================
279
280DNF offers more predictable behavior of installroot. DNF handles the path differently
281from the ``--config`` command-line option, where this path is always related to the host
282system (YUM combines this path with installroot). Reposdir is also handled slightly
283differently, if one path of the reposdirs exists inside of installroot, then
284repos are strictly taken from installroot (YUM tests each path from reposdir
285separately and use installroot path if existed). See the detailed description for
286\-\ :ref:`-installroot <installroot-label>` option.
287
288========================================
289Different prompt after transaction table
290========================================
291
292DNF doesn't provide download functionality after displaying transaction table. It only asks user whether to continue with transaction or not.
293If one wants to download packages, they can use the 'download' command.
294
295========================================
296List command shows all repo alternatives
297========================================
298
299DNF lists all packages from all repos, which means there can be duplicates package names (with different repo name). This is due to providing users
300possibility to choose preferred repo.
301
302
303===============================================
304``yum-langpacks`` subcommands have been removed
305===============================================
306Translations became part of core DNF and it is no longer
307necessary to manage individual language packs.
308
309Following sub-commands were removed:
310
311* langavailable
312* langinstall
313* langremove
314* langlist
315* langinfo
316
317
318###############################################
319 Changes in DNF plugins compared to YUM plugins
320###############################################
321
322=======================================  ================================================================  ===================================
323Original YUM tool                        DNF command/option                                                Package
324---------------------------------------  ----------------------------------------------------------------  -----------------------------------
325``yum check``                            :ref:`dnf repoquery <repoquery_command-label>` ``--unsatisfied``  ``dnf``
326``yum-langpacks``                                                                                          ``dnf``
327``yum-plugin-aliases``                   :ref:`dnf alias <alias_command-label>`                            ``dnf``
328``yum-plugin-auto-update-debug-info``    option in ``debuginfo-install.conf``                              ``dnf-plugins-core``
329``yum-plugin-changelog``                                                                                   ``dnf-plugins-core``
330``yum-plugin-copr``                      `dnf copr`_                                                       ``dnf-plugins-core``
331``yum-plugin-fastestmirror``             ``fastestmirror`` option in `dnf.conf`_                           ``dnf``
332``yum-plugin-fs-snapshot``                                                                                 ``dnf-plugins-extras-snapper``
333``yum-plugin-local``                                                                                       ``dnf-plugins-core``
334``yum-plugin-merge-conf``                                                                                  ``dnf-plugins-extras-rpmconf``
335``yum-plugin-post-transaction-actions``                                                                    ``dnf-plugins-core``
336``yum-plugin-priorities``                ``priority`` option in `dnf.conf`_                                ``dnf``
337``yum-plugin-remove-with-leaves``        :ref:`dnf autoremove <autoremove_command-label>`                  ``dnf``
338``yum-plugin-show-leaves``                                                                                 ``dnf-plugins-core``
339``yum-plugin-tmprepo``                   ``--repofrompath`` option                                         ``dnf``
340``yum-plugin-tsflags``                   ``tsflags``  option in `dnf.conf`_                                ``dnf``
341``yum-plugin-versionlock``                                                                                 ``python3-dnf-plugin-versionlock``
342``yum-rhn-plugin``                                                                                         ``dnf-plugin-spacewalk``
343=======================================  ================================================================  ===================================
344
345Plugins that have not been ported yet:
346
347``yum-plugin-filter-data``,
348``yum-plugin-keys``,
349``yum-plugin-list-data``,
350``yum-plugin-protectbase``,
351``yum-plugin-ps``,
352``yum-plugin-puppetverify``,
353``yum-plugin-refresh-updatesd``,
354``yum-plugin-rpm-warm-cache``,
355``yum-plugin-upgrade-helper``,
356``yum-plugin-verify``
357
358Feel free to file an RFE_ for missing functionality if you need it.
359
360#################################################
361 Changes in DNF plugins compared to YUM utilities
362#################################################
363
364All ported YUM tools are now implemented as DNF plugins.
365
366=========================  ================================================ =================================
367Original YUM tool          New DNF command                                  Package
368-------------------------  ------------------------------------------------ ---------------------------------
369``debuginfo-install``      `dnf debuginfo-install`_                         ``dnf-plugins-core``
370``find-repos-of-install``  `dnf list installed`_                            ``dnf``
371``needs-restarting``       `dnf tracer`_                                    ``dnf-plugins-extras-tracer``
372``package-cleanup``        :ref:`dnf list <list_command-label>`,
373                           :ref:`dnf repoquery <repoquery_command-label>`   ``dnf``, ``dnf-plugins-core``
374``repoclosure``            `dnf repoclosure`_                               ``dnf-plugins-extras-repoclosure``
375``repodiff``               `dnf repodiff`_                                  ``dnf-plugins-core``
376``repo-graph``             `dnf repograph`_                                 ``dnf-plugins-extras-repograph``
377``repomanage``             `dnf repomanage`_                                ``dnf-plugins-extras-repomanage``
378``repoquery``              :ref:`dnf repoquery <repoquery_command-label>`   ``dnf``
379``reposync``               `dnf reposync`_                                  ``dnf-plugins-core``
380``repotrack``              `dnf download`_ --resolve --alldeps              ``dnf-plugins-core``
381``yum-builddep``           `dnf builddep`_                                  ``dnf-plugins-core``
382``yum-config-manager``     `dnf config-manager`_                            ``dnf-plugins-core``
383``yum-debug-dump``         `dnf debug-dump`_                                ``dnf-plugins-extras-debug``
384``yum-debug-restore``      `dnf debug-restore`_                             ``dnf-plugins-extras-debug``
385``yumdownloader``          `dnf download`_                                  ``dnf-plugins-core``
386=========================  ================================================ =================================
387
388Detailed table for ``package-cleanup`` replacement:
389
390==========================================       ===============================================================
391``package-cleanup --dupes``                      ``dnf repoquery --duplicates``
392``package-cleanup --leaves``                     ``dnf repoquery --unneeded``
393``package-cleanup --orphans``                    ``dnf repoquery --extras``
394``package-cleanup --problems``                   ``dnf repoquery --unsatisfied``
395``package-cleanup --cleandupes``                 ``dnf remove --duplicates``
396``package-cleanup --oldkernels``                 ``dnf remove --oldinstallonly``
397``package-cleanup --oldkernels --keep=2``        ``dnf remove $(dnf repoquery --installonly --latest-limit=-2)``
398==========================================       ===============================================================
399
400=============================
401yum-updateonboot and yum-cron
402=============================
403
404DNF does not have a direct replacement of yum-updateonboot and yum-cron commands.
405However, the similar result can be achieved by ``dnf automatic`` command (see :doc:`automatic`).
406
407You can either use the shortcut::
408
409  $ systemctl enable --now dnf-automatic-install.timer
410
411Or set ``apply_updates`` option of ``/etc/dnf/automatic.conf`` to True and use generic timer unit::
412
413  $ systemctl enable --now dnf-automatic.timer
414
415The timer in both cases is activated 1 hour after the system was booted up and then repetitively once every 24 hours. There is also a random delay on these timers set to 5 minutes. These values can be tweaked via ``dnf-automatic*.timer`` config files located in the ``/usr/lib/systemd/system/`` directory.
416
417
418=======================================
419Utilities that have not been ported yet
420=======================================
421
422``repo-rss``,
423``show-changed-rco``,
424``show-installed``,
425``verifytree``,
426``yum-groups-manager``
427
428Take a look at the FAQ_ about YUM to DNF migration. Feel free to file an RFE_ for missing functionality if you need it.
429
430.. _dnf debuginfo-install: http://dnf-plugins-core.readthedocs.org/en/latest/debuginfo-install.html
431.. _dnf list installed: http://dnf.readthedocs.org/en/latest/command_ref.html
432.. _dnf tracer: http://dnf-plugins-extras.readthedocs.org/en/latest/tracer.html
433.. _dnf repoclosure: http://dnf-plugins-extras.readthedocs.org/en/latest/repoclosure.html
434.. _dnf repodiff: http://dnf-plugins-core.readthedocs.org/en/latest/repodiff.html
435.. _dnf repograph: http://dnf-plugins-extras.readthedocs.org/en/latest/repograph.html
436.. _dnf repomanage: http://dnf-plugins-extras.readthedocs.org/en/latest/repomanage.html
437.. _dnf reposync: http://dnf-plugins-core.readthedocs.org/en/latest/reposync.html
438.. _dnf download: http://dnf-plugins-core.readthedocs.org/en/latest/download.html
439.. _dnf builddep: http://dnf-plugins-core.readthedocs.org/en/latest/builddep.html
440.. _dnf config-manager: http://dnf-plugins-core.readthedocs.org/en/latest/config_manager.html
441.. _dnf debug-dump: http://dnf-plugins-extras.readthedocs.org/en/latest/debug.html
442.. _dnf debug-restore: http://dnf-plugins-extras.readthedocs.org/en/latest/debug.html
443.. _dnf copr: http://rpm-software-management.github.io/dnf-plugins-core/copr.html
444.. _dnf.conf: http://dnf.readthedocs.org/en/latest/conf_ref.html
445.. _RFE: https://github.com/rpm-software-management/dnf/wiki/Bug-Reporting#new-feature-request
446.. _FAQ: http://dnf.readthedocs.io/en/latest/user_faq.html
447