Bug 1227066 - dnf incorrectly uninstalling dependencies
Summary: dnf incorrectly uninstalling dependencies
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 23
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-01 21:33 UTC by Adam Miller
Modified: 2016-06-20 22:25 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-20 22:25:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1198660 0 unspecified CLOSED group remove: keep mandatory pkgs of other installed groups 2021-02-22 00:41:40 UTC

Internal Links: 1198660

Description Adam Miller 2015-06-01 21:33:27 UTC
Description of problem:
dnf is attempting to uninstall dependencies that it shouldn't be.

Version-Release number of selected component (if applicable):
dnf-1.0.0-1.fc23.noarch
yum-3.4.3-506.fc23.noarch

$ sudo dnf remove pungi
Dependencies resolved.
=======================================================================================================================
 Package                            Arch             Version                                   Repository         Size
=======================================================================================================================
Removing:
 GConf2                             x86_64           3.2.6-13.fc23                             @System           6.3 M
 cairo                              x86_64           1.14.2-1.fc23                             @System           1.8 M
 createrepo                         noarch           0.10.3-3.fc21                             @System           301 k
 dbus-glib                          x86_64           0.104-2.fc23                              @System           326 k
 dosfstools                         x86_64           3.0.27-1.fc22                             @System           251 k
 fedora-logos                       x86_64           22.0.0-1.fc23                             @System           8.8 M
 fedup-dracut                       x86_64           0.9.2-1.fc23                              @System            63 k
 fedup-dracut-plymouth              noarch           0.9.2-1.fc23                              @System           355 k
 genisoimage                        x86_64           1.1.11-28.fc23                            @System           1.1 M
 graphite2                          x86_64           1.2.4-4.fc23                              @System           175 k
 harfbuzz                           x86_64           0.9.40-2.fc23                             @System           406 k
 hfsplus-tools                      x86_64           540.1.linux3-9.fc22                       @System           318 k
 hwdata                             noarch           0.278-1.fc23                              @System           5.5 M
 isomd5sum                          x86_64           1:1.0.12-3.fc22                           @System            54 k
 libXdamage                         x86_64           1.1.4-6.fc23                              @System            29 k
 libXfixes                          x86_64           5.0.1-4.fc23                              @System            26 k
 libXft                             x86_64           2.3.2-2.fc23                              @System           125 k
 libXrender                         x86_64           0.9.9-1.fc23                              @System            45 k
 libXxf86vm                         x86_64           1.1.4-1.fc23                              @System            25 k
 libdatrie                          x86_64           0.2.8-5.fc22                              @System            58 k
 libdrm                             x86_64           2.4.61-3.fc23                             @System           280 k
 libpciaccess                       x86_64           0.13.4-1.fc23                             @System            44 k
 libthai                            x86_64           0.1.21-1.fc22                             @System           714 k
 libusal                            x86_64           1.1.11-28.fc23                            @System           454 k
 libwayland-client                  x86_64           1.7.92-1.fc23                             @System            56 k
 libwayland-server                  x86_64           1.7.92-1.fc23                             @System            72 k
 libxml2-python                     x86_64           2.9.2-4.fc23                              @System           1.4 M
 libxshmfence                       x86_64           1.2-1.fc23                                @System            11 k
 lorax                              x86_64           23.9-1.fc23                               @System           454 k
 lz4                                x86_64           r129-1.fc23                               @System           267 k
 mesa-libEGL                        x86_64           10.6.0-0.devel.6.5a55f68.fc23             @System           189 k
 mesa-libGL                         x86_64           10.6.0-0.devel.6.5a55f68.fc23             @System           639 k
 mesa-libgbm                        x86_64           10.6.0-0.devel.6.5a55f68.fc23             @System            81 k
 mesa-libglapi                      x86_64           10.6.0-0.devel.6.5a55f68.fc23             @System           186 k
 pango                              x86_64           1.36.8-5.fc23                             @System           792 k
 pigz                               x86_64           2.3.3-2.fc23                              @System           127 k
 pixman                             x86_64           0.32.6-4.fc23                             @System           700 k
 plymouth                           x86_64           0.8.9-9.2013.08.14.fc23                   @System           230 k
 plymouth-core-libs                 x86_64           0.8.9-9.2013.08.14.fc23                   @System           193 k
 plymouth-graphics-libs             x86_64           0.8.9-9.2013.08.14.fc23                   @System            39 k
 plymouth-plugin-label              x86_64           0.8.9-9.2013.08.14.fc23                   @System            15 k
 plymouth-plugin-two-step           x86_64           0.8.9-9.2013.08.14.fc23                   @System            35 k
 plymouth-scripts                   x86_64           0.8.9-9.2013.08.14.fc23                   @System            22 k
 polkit-libs                        x86_64           0.112-9.fc22                              @System           181 k
 psmisc                             x86_64           22.21-6.fc23                              @System           494 k
 pungi                              noarch           4.0-0.8.git.0.72088e1.fc22                @System           783 k
 python-deltarpm                    x86_64           3.6-9.fc23                                @System            46 k
 python-kickstart                   noarch           2.7-1.fc23                                @System           1.5 M
 python-kid                         noarch           0.9.6-14.fc21                             @System           664 k
 python-lockfile                    noarch           1:0.10.2-1.fc22                           @System            85 k
 python-productmd                   noarch           1.0-3.fc23.git57efab                      @System           211 k
 python3-beaker                     noarch           1.5.4-10.fc21                             @System           247 k
 python3-kickstart                  noarch           2.7-1.fc23                                @System           1.4 M
 python3-mako                       noarch           1.0.1-1.fc22                              @System           556 k
 repoview                           noarch           0.6.6-6.fc21                              @System            87 k
 squashfs-tools                     x86_64           4.3-8.fc23                                @System           380 k

Transaction Summary
=======================================================================================================================
Remove  56 Packages

Installed size: 39 M
Is this ok [y/N]: n
Operation aborted.

$ sudo yum-deprecated remove pungi
Yum command has been deprecated, use dnf instead.
See 'man dnf' and 'man yum2dnf' for more information.

Resolving Dependencies
--> Running transaction check
---> Package pungi.noarch 0:4.0-0.8.git.0.72088e1.fc22 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================
 Package              Arch                  Version                                     Repository                Size
=======================================================================================================================
Removing:
 pungi                noarch                4.0-0.8.git.0.72088e1.fc22                  installed                783 k

Transaction Summary
=======================================================================================================================
Remove  1 Package

Installed size: 783 k
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Erasing    : pungi-4.0-0.8.git.0.72088e1.fc22.noarch                                                             1/1
  Verifying  : pungi-4.0-0.8.git.0.72088e1.fc22.noarch                                                             1/1

Removed:
  pungi.noarch 0:4.0-0.8.git.0.72088e1.fc22

Complete!
[fedora@admiller-rawhide ~]$ sudo dnf install pungi-4.0-0.8.fc22.noarch.rpm
Last metadata expiration check performed 2:22:35 ago on Mon Jun  1 19:07:41 2015.
Dependencies resolved.
=======================================================================================================================
 Package                 Arch                     Version                         Repository                      Size
=======================================================================================================================
Installing:
 pungi                   noarch                   4.0-0.8.fc22                    @commandline                   213 k

Transaction Summary
=======================================================================================================================
Install  1 Package

Total size: 213 k
Installed size: 783 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Installing  : pungi-4.0-0.8.fc22.noarch                                                                          1/1
  Verifying   : pungi-4.0-0.8.fc22.noarch                                                                          1/1

Installed:
  pungi.noarch 4.0-0.8.fc22

Comment 1 Orion Poplawski 2015-06-24 16:18:56 UTC
Does it work properly if you set:

clean_requirements_on_remove=false

in /etc/dnf/dnf.conf?  Not sure why the default is on.

Comment 2 Jan Kurik 2015-07-15 14:04:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 3 Honza Silhan 2015-07-24 09:52:56 UTC
Thanks for the report. Please, answer the question from comment 1 and attach the debugdata [1]

[1] https://github.com/rpm-software-management/dnf/wiki/Bug-Reporting#dependency-resolution-problem

Comment 4 Orion Poplawski 2015-10-30 21:44:17 UTC
I think one source of this issue is that I don't think packages requested at install time are being marked as wanted by dnf, so dnf feels free to remove them with clean_requirements_on_remove=true.

Comment 5 Jacek Pliszka 2015-11-22 11:37:14 UTC
Got it too.

Setting clean_requirements_on_remove=false

fixes it.

Comment 6 Adam Miller 2016-01-11 18:17:58 UTC
Yes, clean_requirements_on_remove=false seems to fix it but I don't know the full implications of that option.

Comment 7 Stephen Herr 2016-05-23 16:21:49 UTC
This is extremely dangerous behavior, especially in concert with bug 1338921. It can easily lead to an unbootable system if the user happens to remove something that depends on a systemish thing. For more info see bug 1338921. Setting severity and priority to urgent.

Comment 8 Stephen Herr 2016-05-23 16:34:53 UTC
Perhaps it's not that the option is set, it's that the
"Finding unneeded leftover dependencies"
step is not detecting "unneeded" properly. It finds too much, including packages that are needed by other things.

Comment 9 Stephen Herr 2016-05-24 19:09:46 UTC
After investigation it turns out that bug 1338921 was closed as notabug (rightly), because the root problem was 3rd-party packages claiming they provide libraries that the system linker cannot find. That is rightly closed as a problem on the 3rd-party packages, not dnf.

This bug however I will argue is very much still real and deserves the urgent status. A nice-to-have feature like automatic leaf dependency cleanup is much less important than not blowing up people's systems in the presence of sub-optimal packaging. Also what is a "leaf dependency" or not is very much a matter of subjective opinion. In the example in comment 0 for example just because I don't want 'GConf2' doesn't mean I no longer want 'createrepo', even though nothing strictly depends on it.

This option really needs to default to false or be removed entirely with the feature being permanently disabled; it's just too dangerous to do otherwise.

Comment 10 Fedora Update System 2016-06-14 12:57:54 UTC
libsolv-0.6.22-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-6b1f2faa7d

Comment 11 Fedora Update System 2016-06-14 14:57:33 UTC
libsolv-0.6.22-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-6b1f2faa7d

Comment 12 Fedora Update System 2016-06-20 22:24:55 UTC
libsolv-0.6.22-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.