Bug 1222812 - dnf autoremoves zlib
Summary: dnf autoremoves zlib
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 22
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1260299 1280451 1293964 1296289 1319967 1325736 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-19 08:40 UTC by Fabio Valentini
Modified: 2016-04-11 11:23 UTC (History)
22 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-11 15:23:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
corpus delicti (237.08 KB, image/png)
2015-05-19 08:40 UTC, Fabio Valentini
no flags Details
dnf trying to remove sqlite plus output requested. (43.99 KB, text/plain)
2015-06-20 17:02 UTC, Jason Montleon
no flags Details
debug data (4.68 MB, application/x-xz)
2015-06-21 14:54 UTC, Jason Montleon
no flags Details
output of dnf history userinstalled (3.05 KB, text/plain)
2015-07-23 09:55 UTC, Fabio Valentini
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1190141 0 unspecified CLOSED dnf autoerase -- erases more than "leaf" packages 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1259865 0 unspecified CLOSED call `dnf mark install <pkgs...>`on packages installed from PK 2021-02-22 00:41:40 UTC

Internal Links: 1190141 1259865 1303721

Description Fabio Valentini 2015-05-19 08:40:42 UTC
Created attachment 1027037 [details]
corpus delicti

I did the following:
- dnf install alacarte
- dnf remove alacarte

What happened:
dnf removed alacarte.
AND dnf autoremoved zlib(!) and sqlite

- which results in an utterly unusable and broken system.
I could only repair it from another install of fedora on a seperate partition.

Might this problem be a leftover of the rpm package dependency generation bug I read about?

If this also happens in the background when removing software in gnome-software, it would be disastrous for most users (system is unrecoverably broken without seperate linux install).



Version-Release number of selected component (if applicable):
rpm-4.12.0.1-9.fc22.x86_64
dnf-1.0.0-1.fc22.noarch


How reproducible:
Not sure, sometimes just happens when removing installed applications (happened for firefox once, and then for alacarte)

Comment 1 Honza Silhan 2015-05-20 11:54:17 UTC
Thanks for the report. First of all it shouldn't remove sqlite in any case (DNF requires sqlite and DNF is protected package) -> added missing requirement to DNF spec.

(In reply to Fabio Valentini from comment #0)
> Created attachment 1027037 [details]
> corpus delicti
> 
> I did the following:
> - dnf install alacarte
> - dnf remove alacarte
> 
> What happened:
> dnf removed alacarte.
> AND dnf autoremoved zlib(!) and sqlite
> 
> - which results in an utterly unusable and broken system.
> I could only repair it from another install of fedora on a seperate
> partition.
> 
> Might this problem be a leftover of the rpm package dependency generation
> bug I read about?

I don't know what you are talking about. Can you post #BZ?

> If this also happens in the background when removing software in
> gnome-software

Gnome-software don't use DNF - it uses DNF's C libraries and probably doesn't do autoremove.

Was there a time where you didn't have sqlite package installed and you had to install it manually? When such removal triggers again, can you stop the transaction and post output of `dnf history userinstalled`, `dnf list installed` and attach debugdata [1] after execution of `dnf autoremove --debugsolver --assumeno`, please?

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

Comment 2 Fabio Valentini 2015-05-20 17:31:12 UTC
I will try to gather more information about the issue if it pops up again.

In the meantime, I found the bug report I mentioned:
https://bugzilla.redhat.com/show_bug.cgi?id=1207945

One of the commenters (comm #3) points out that the bug might result in many packages shipping for f22 without correct dependencies (I don't think all affected packages have been rebuilt in the meantime).

Comment 3 Radek Holy 2015-05-21 07:07:09 UTC
(In reply to Jan Silhan from comment #1)
> First of all it shouldn't remove sqlite in any case
> (DNF requires sqlite and DNF is protected package) -> added missing
> requirement to DNF spec.

No, it requires Python's sqlite which is part of Python's standard library.

Comment 4 Jason Montleon 2015-06-20 16:45:35 UTC
I just had the same happen:
Here it is trying to remove sqlite:
dnf remove sqlite.i686
Dependencies resolved.
==========================================================================================================================================
 Package                           Arch                         Version                               Repository                     Size
==========================================================================================================================================
Removing:
 nss                               i686                         3.19.1-1.0.fc22                       @System                       2.4 M
 nss-softokn                       i686                         3.19.1-1.0.fc22                       @System                       1.1 M
 sqlite                            i686                         3.8.10.2-1.fc22                       @System                       939 k
 sqlite                            x86_64                       3.8.10.2-1.fc22                       @System                       922 k

Transaction Summary
==========================================================================================================================================
Remove  4 Packages

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


Here it removed zlib on me. I had to copy libz.so.1 back on a thumb drive so I could reinstall it...

dnf remove ntfsprogs
Dependencies resolved.
==========================================================================================================================================
 Package                        Arch                        Version                                    Repository                    Size
==========================================================================================================================================
Removing:
 ntfs-3g                        x86_64                      2:2015.3.14-2.fc22                         @System                      661 k
 ntfsprogs                      x86_64                      2:2015.3.14-2.fc22                         @System                      872 k
 zlib                           x86_64                      1.2.8-7.fc22                               @System                      184 k

Transaction Summary
==========================================================================================================================================
Remove  3 Packages

Installed size: 1.7 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Erasing     : ntfsprogs-2:2015.3.14-2.fc22.x86_64                                                                                   1/3 
  Erasing     : ntfs-3g-2:2015.3.14-2.fc22.x86_64                                                                                     2/3 
  Erasing     : zlib-1.2.8-7.fc22.x86_64                                                                                              3/3 
  Verifying   : zlib-1.2.8-7.fc22.x86_64                                                                                              1/3 
  Verifying   : ntfs-3g-2:2015.3.14-2.fc22.x86_64                                                                                     2/3 
  Verifying   : ntfsprogs-2:2015.3.14-2.fc22.x86_64                                                                                   3/3 

Removed:
  ntfs-3g.x86_64 2:2015.3.14-2.fc22               ntfsprogs.x86_64 2:2015.3.14-2.fc22               zlib.x86_64 1.2.8-7.fc22              

Complete!
[root@mini ~]# clear
[3;J
[root@mini ~]# dnf leaves
Traceback (most recent call last):
  File "/usr/bin/dnf", line 35, in <module>
    from dnf.cli import main
  File "/usr/lib/python2.7/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 26, in <module>
    from dnf.comps import CompsQuery
  File "/usr/lib/python2.7/site-packages/dnf/comps.py", line 29, in <module>
    import dnf.util
  File "/usr/lib/python2.7/site-packages/dnf/util.py", line 31, in <module>
    import librepo
  File "/usr/lib64/python2.7/site-packages/librepo/__init__.py", line 1001, in <module>
    import librepo._librepo
ImportError: libz.so.1: cannot open shared object file: No such file or directory
[root@mini ~]# dnf leaves
Traceback (most recent call last):
  File "/usr/bin/dnf", line 35, in <module>
    from dnf.cli import main
  File "/usr/lib/python2.7/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 26, in <module>
    from dnf.comps import CompsQuery
  File "/usr/lib/python2.7/site-packages/dnf/comps.py", line 29, in <module>
    import dnf.util
  File "/usr/lib/python2.7/site-packages/dnf/util.py", line 31, in <module>
    import librepo
  File "/usr/lib64/python2.7/site-packages/librepo/__init__.py", line 1001, in <module>
    import librepo._librepo
ImportError: libz.so.1: cannot open shared object file: No such file or directory

Comment 5 Jason Montleon 2015-06-20 17:02:28 UTC
Created attachment 1041245 [details]
dnf trying to remove sqlite plus output requested.

Comment 6 Jason Montleon 2015-06-20 17:05:35 UTC
and it will allow removal of libidn:
dnf leaves
Traceback (most recent call last):
  File "/usr/bin/dnf", line 35, in <module>
    from dnf.cli import main
  File "/usr/lib/python2.7/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 26, in <module>
    from dnf.comps import CompsQuery
  File "/usr/lib/python2.7/site-packages/dnf/comps.py", line 29, in <module>
    import dnf.util
  File "/usr/lib/python2.7/site-packages/dnf/util.py", line 31, in <module>
    import librepo
  File "/usr/lib64/python2.7/site-packages/librepo/__init__.py", line 1001, in <module>
    import librepo._librepo
ImportError: libidn.so.11: cannot open shared object file: No such file or directory

Comment 7 Jason Montleon 2015-06-21 14:54:21 UTC
Created attachment 1041423 [details]
debug data

Comment 10 mryodatak 2015-07-19 03:54:47 UTC
Same for me with transmission

root@linux-2-1 [05:44:32] [/var/lib/transmission]
-> # dnf remove transmission
Dépendances résolues.
===================================================================================================================================================================
 Paquet                                         Architecture                      Version                                 Dépôt                              Taille
===================================================================================================================================================================
Suppression :
 libidn                                         x86_64                            1.29-3.fc22                             @System                            586 k
 transmission-common                            x86_64                            2.84-7.fc22                             @System                            2.9 M
 transmission-daemon                            x86_64                            2.84-7.fc22                             @System                            549 k

Résumé de la transaction
===================================================================================================================================================================
Supprimer  3 Packages

Taille d'installation : 4.0 M
Est-ce correct [o/N] : o
Test de la transaction en cours
La vérification de la transaction a réussi.
Lancement de la transaction de test
Transaction de test réussie.
Exécution de la transaction
  Suppression                    : transmission-daemon-2.84-7.fc22.x86_64                                                                                      1/3
  Suppression                    : transmission-common-2.84-7.fc22.x86_64                                                                                      2/3
  Suppression                    : libidn-1.29-3.fc22.x86_64                                                                                                   3/3
  Vérifie                        : libidn-1.29-3.fc22.x86_64                                                                                                   1/3
  Vérifie                        : transmission-common-2.84-7.fc22.x86_64                                                                                      2/3
  Vérifie                        : transmission-daemon-2.84-7.fc22.x86_64                                                                                      3/3

Supprimés :
  libidn.x86_64 1.29-3.fc22                    transmission-common.x86_64 2.84-7.fc22                    transmission-daemon.x86_64 2.84-7.fc22

Comment 11 Honza Silhan 2015-07-22 13:02:14 UTC
Fabio, can you post the output of "sudo dnf history userinstalled", please?

Comment 12 Fabio Valentini 2015-07-23 09:55:44 UTC
Created attachment 1055271 [details]
output of dnf history userinstalled

I think sqlite and zlib show up in this list because I had to copy libz.so.0 and libsqlite3.so.0 over from my fedora rawhide partition and reinstall the packages manually.

Comment 13 Alexandre Rosenfeld 2015-09-01 02:26:58 UTC
I just had the same issue trying to uninstall gstreamer1-libav, which automatically removed libidn and primus, resulting in a broken system because of dnf no longer finding libidn:

➜  Videos  sudo dnf remove gstreamer1-libav
Dependencies resolved.
================================================================================
 Package               Arch        Version                   Repository    Size
================================================================================
Removing:
 gstreamer1-libav      x86_64      1.4.5-1.fc22              @System      7.3 M
 libidn                x86_64      1.32-1.fc22               @System      647 k
 primus                x86_64      1.1.03282015-2.fc22       @System      339 k

Transaction Summary
================================================================================
Remove  3 Packages

Installed size: 8.3 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Erasing     : primus-1.1.03282015-2.fc22.x86_64                           1/3 
  Erasing     : libidn-1.32-1.fc22.x86_64                                   2/3 
  Erasing     : gstreamer1-libav-1.4.5-1.fc22.x86_64                        3/3 
  Verifying   : gstreamer1-libav-1.4.5-1.fc22.x86_64                        1/3 
  Verifying   : libidn-1.32-1.fc22.x86_64                                   2/3 
  Verifying   : primus-1.1.03282015-2.fc22.x86_64                           3/3 

Removed:
  gstreamer1-libav.x86_64 1.4.5-1.fc22         libidn.x86_64 1.32-1.fc22        
  primus.x86_64 1.1.03282015-2.fc22           

Complete!

➜  Videos  sudo dnf install primus
Traceback (most recent call last):
  File "/bin/dnf", line 35, in <module>
    from dnf.cli import main
  File "/usr/lib/python2.7/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 26, in <module>
    from dnf.comps import CompsQuery
  File "/usr/lib/python2.7/site-packages/dnf/comps.py", line 29, in <module>
    import dnf.util
  File "/usr/lib/python2.7/site-packages/dnf/util.py", line 31, in <module>
    import librepo
  File "/usr/lib64/python2.7/site-packages/librepo/__init__.py", line 1001, in <module>
    import librepo._librepo
ImportError: libidn.so.11: cannot open shared object file: No such file or directory

Comment 14 Benjamin Xiao 2015-09-01 06:01:23 UTC
I too had an issue where "dnf remove cockpit" would remove selinux-policy and selinux-policy-targeted, resulting in SELinux getting disabled without warning.

This only happens on systems where I used gnome-software to update packages, instead of relying solely on dnf.

Comment 15 Alexandre Rosenfeld 2015-09-01 17:34:10 UTC
If it helps in anyway, I too use gnome-software to upgrade my system from time to time (in fact, I just had my system upgraded with the offline upgrade available in Gnome).

Comment 16 Radek Holy 2015-09-07 12:38:51 UTC
*** Bug 1260299 has been marked as a duplicate of this bug. ***

Comment 17 Will Woods 2015-09-08 18:02:58 UTC
See bug 1259865, but it appears this behavior can be caused by installing things with wonky "Provides:", using PackageKit.

In my case, the "plexmediaserver" RPM claims to Provide the same things as libidn, so erasing packages could cause libidn to be auto-removed.

Reinstalling "plexmediaserver" using DNF was sufficient to fix problem.

Comment 18 Radek Holy 2015-09-09 09:38:19 UTC
(In reply to Will Woods from comment #17)
> Reinstalling "plexmediaserver" using DNF was sufficient to fix problem.

Please, let me note that it's just a coincidence that "dnf reinstall" "fixes" the problem. There is a bug in how DNF handles the "userinstalled" flag when reinstalling packages. It completely removes the information about the reason why a package was installed which in turn results in handling the package as "userinstalled". And TBH I'm not sure how would the reinstall command behave (in this respect) once we fix it. I'd rather recommend people the new "dnf mark install" command once DNF 1.1.1 is pushed to stable.

Comment 19 Tomas Drvota 2015-09-17 17:55:18 UTC
Hello,

I'm experiencing exactly the same issue and I'm also using plexmediaserver. Please, how can I reinstall this app with dnf if any action with dnf returns the same error? Graphic apps for apps management doesn't work as well.

Thanks

Comment 20 Will Woods 2015-09-18 19:17:46 UTC
(In reply to Tomas Drvota from comment #19)

> I'm experiencing exactly the same issue and I'm also using plexmediaserver.
> Please, how can I reinstall this app with dnf if any action with dnf returns
> the same error? Graphic apps for apps management doesn't work as well.

To fix DNF, you can download the libidn package manually (from a mirror or http://koji.fedoraproject.org/) and install it using `rpm -ivh`.

Comment 21 Roni Laukkarinen 2015-10-27 13:40:14 UTC
I have had this problem many times now (last time with libidn when removing transmission-deamon). Steps to fix in addition to Will's tip before if your RPM is not working:

Download package to your computer from http://koji.fedoraproject.org/koji/ . If you can't use RPM because it's broken, use a Mac or another Linux and run for example: `rpm2cpio libidn-1.32-1.fc22.x86_64.rpm | cpio -idmv` and copy over the source (you'll have to symlink them by hand).

Other option: run identical virtualbox on another computer and copy the files over.

Comment 22 Fabio Valentini 2015-11-11 12:13:24 UTC
I just tried out all the triggers mentioned above, and none of them caused the unwanted behaviour anymore.
And I did not encounter this problem in a while now, has it been fixed?

And if so, would someone please confirm that, so this bug can be closed?
Just trying to clean up after myself on RHBZ ...

Comment 23 Michal Luscon 2015-11-11 15:23:53 UTC
I can confirm that the issue with libidn removal was caused by plexmediaserver package, which does not seem to be shipped by Fedora.

I also presume that the zlib removal was based on the similar principle.

If there is anybody who can reproduce removing of zlib, please reopen this report and provide a debugdata (--debugsolver).

Comment 24 Michal Luscon 2015-11-18 13:51:25 UTC
*** Bug 1280451 has been marked as a duplicate of this bug. ***

Comment 25 Michal 2015-12-10 09:23:15 UTC
Same problem here with intltool and liferea packages:

$ sudo dnf remove intltool
Dependencies resolved.
=========================================================================================================
 Package                         Arch              Version                     Repository           Size
=========================================================================================================
Removing:
 autoconf                        noarch            2.69-21.fc23                @fedora             2.2 M
 automake                        noarch            1.15-4.fc23                 @fedora             1.7 M
 gettext-common-devel            noarch            0.19.6-1.fc23               @fedora             380 k
 gettext-devel                   x86_64            0.19.6-1.fc23               @fedora             1.4 M
 intltool                        noarch            0.51.0-3.fc23               @fedora             169 k
 m4                              x86_64            1.4.17-8.fc23               @fedora             526 k
 patch                           x86_64            2.7.5-2.fc23                @fedora             231 k
 perl-Thread-Queue               noarch            3.07-1.fc23                 @updates             28 k
 perl-XML-Parser                 x86_64            2.44-3.fc23                 @fedora             627 k
 zlib                            x86_64            1.2.8-9.fc23                @fedora             183 k

Transaction Summary
=========================================================================================================
Remove  10 Packages

$ sudo dnf remove liferea
Dependencies resolved.
=========================================================================================================
 Package             Arch               Version                       Repository                    Size
=========================================================================================================
Removing:
 libogg              x86_64             2:1.3.2-4.fc23                @koji-override-0              34 k
 libpng              x86_64             2:1.6.19-1.fc23               @updates                     211 k
 libuuid             x86_64             2.27.1-2.fc23                 @updates                      21 k
 liferea             x86_64             1:1.10.17-1.fc23              @updates                     3.0 M
 sqlite              x86_64             3.9.0-1.fc23                  @updates                     942 k
 zlib                x86_64             1.2.8-9.fc23                  @fedora                      183 k

Transaction Summary
=========================================================================================================
Remove  6 Packages

Also autoremove won't work:

$ sudo dnf autoremove --debugsolver --assumeno
Last metadata expiration check performed 0:14:09 ago on Thu Dec 10 09:08:17 2015.
Error: problem with installed package libogg-2:1.3.2-4.fc23.i686.
problem with installed package libpng12-1.2.50-9.fc23.i686.
problem with installed package libtxc_dxtn-1:1.0.1-1.gitef072983.fc23.i686.
problem with installed package zlib-1.2.8-9.fc23.i686
(try to add '--allowerasing' to command line to replace conflicting packages)

Comment 26 Cristian Contescu 2015-12-20 07:50:55 UTC
I think this is really serious and should be investigated further (no plexmediaserver installed on my box):

$ sudo dnf remove gnome-mines-3.18.2-1.fc23.x86_64 
[sudo] password for kristi: 
Dependencies resolved.
==============================================================================================================================================================================================================================================
 Package                                                 Arch                                               Version                                                        Repository                                                    Size
==============================================================================================================================================================================================================================================
Removing:
 gnome-mines                                             x86_64                                             3.18.2-1.fc23                                                  @updates                                                     6.5 M
 libpng                                                  x86_64                                             2:1.6.19-1.fc23                                                @updates                                                     211 k
 sqlite                                                  x86_64                                             3.9.0-1.fc23                                                   @updates                                                     942 k
 zlib                                                    x86_64                                             1.2.8-9.fc23                                                   @koji-override-0                                             183 k

Transaction Summary
==============================================================================================================================================================================================================================================
Remove  4 Packages

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

Could it be because zlib is provided both by the 64bit and the 32bit package, and the requirements of the packages needing zlib.x86_64 do not specify the architecture?

[kristi@papoi ~]$ rpm -q --whatprovides zlib
zlib-1.2.8-9.fc23.x86_64
zlib-1.2.8-9.fc23.i686

Comment 27 Cristian Contescu 2015-12-20 07:52:25 UTC
A workaround was to re-install zlib; this seems to fix the problem for the moment, but still!

Comment 28 Honza Silhan 2016-01-04 13:22:31 UTC
*** Bug 1293964 has been marked as a duplicate of this bug. ***

Comment 29 Honza Silhan 2016-01-11 13:04:56 UTC
*** Bug 1296289 has been marked as a duplicate of this bug. ***

Comment 30 Michal Luscon 2016-03-22 09:51:31 UTC
*** Bug 1319967 has been marked as a duplicate of this bug. ***

Comment 31 Michal Luscon 2016-04-11 11:20:05 UTC
*** Bug 1325736 has been marked as a duplicate of this bug. ***


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