Bug 315063 - doesn't handle dependencies on package removal
Summary: doesn't handle dependencies on package removal
Status: RESOLVED FIXED
Alias: None
Product: apper
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Daniel Nicoletti
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-13 13:15 UTC by Rex Dieter
Modified: 2015-10-28 13:27 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rex Dieter 2013-02-13 13:15:56 UTC
On fedora 18,  using apper-0.8.0-2.fc18.x86_64

apper doesn't seem handle dependencies on package removal.  Example,

$ rpm -e okular
error: Failed dependencies:
        okular >= 4.10.0 is needed by (installed) kdegraphics-7:4.10.0-1.fc18.noarch
        okular >= 4.10.00 is needed by (installed) calligra-okular-odpgenerator-2.6.0-1.fc18.x86_64

$ sudo yum remove okular
 Package                                             Arch                          Version                                Repository                        Size
=================================================================================================================================================================
Removing:
 okular ...
Removing for dependencies:
 calligra-okular-odpgenerator ...
 kdegraphics ...

try to use apper to remove okular, yields error box:
Dependency resolution failed - Apper

A package dependency could not be found. More information...

Details:  package could not be removed, as other packages depend on it.





Reproducible: Always
Comment 1 Daniel Nicoletti 2013-02-13 20:23:42 UTC
Please fill a bug against the backend you are currently using.
you should get the same problem if you try:
pkcon remove okular
Comment 2 Rex Dieter 2013-02-14 13:38:26 UTC
Ufortunately, that seems to be not the case.

$ rpm -q okular
okular-4.10.0-1.fc18.x86_64

$ pkcon remove okular
Removing                      [=========================]         
Waiting in queue              [=========================]         
Starting                      [=========================]         
Running                       [=========================]         
Resolving dependencies        [=========================]         
Removing packages             [=========================]         
The following packages have to be removed:
 calligra-okular-odpgenerator-2.6.0-1.fc18.x86_64       OpenDocument presenter support for okular
 okular-4.10.0-1.fc18.x86_64    A document viewer
 kdegraphics-7:4.10.0-1.fc18.noarch     KDE Graphics Applications
Proceed with changes? [N/y] y

... get policykit-autentication prompt ...

                              [=========================]         
Removing                      [=========================]         
Waiting in queue              [=========================]         
Waiting for authentication    [=========================]         
Waiting in queue              [=========================]         
Starting                      [=========================]         
Running                       [=========================]         
Resolving dependencies        [=========================]         
Downloading packages          [=========================]         
Testing changes               [=========================]         
Removing packages             [=========================]         

$ rpm -q okular
package okular is not installed
Comment 3 Daniel Nicoletti 2013-02-14 14:53:25 UTC
Odd, let me try here...
Comment 4 fishears 2014-03-04 16:39:10 UTC
I'm suffering the same symptoms here.
Fedora 20, apper-0.8.1-2.fc20.x86_64
Today I was trying to remove Thunar-1.6.3-2.fc20.x86_64 which has one dependent package installed, thunarx-python-0.2.3-9.fc20.x86_64

pkcon handles it just fine:
[root@localhost jb]# pkcon remove Thunar
Resolving                     [=========================]         
Querying                      [=========================]         
Testing changes               [=========================]         
Finished                      [                         ] (0%)  
The following packages have to be removed:
 thunarx-python-0.2.3-9.fc20.x86_64     Python bindings for the Thunar Extension Framework

But apper gives me the "Dependency Resolution Failed" dialog.

Also, if I try using rpm I get this:
[root@localhost jb]# rpm -e Thunar
error: Failed dependencies:
        libthunarx-2.so.0()(64bit) is needed by (installed) thunarx-python-0.2.3-9.fc20.x86_64


Let me know if I can provide more details to get this solved.
Comment 5 246824681 2014-09-21 04:14:03 UTC
Again, not shure if this is the same Problem here.
(Fedora20-32bit)

A couple of times Apper was giving me the same (stupid) error message, instead of removing two or more packages depending on each other, even marking all the packages for removal.

"yum remove packagename" works fine!

If it happens again, I'll try pkcon ;)
Comment 6 Kevin Kofler 2014-12-07 02:56:36 UTC
See: https://bugzilla.redhat.com/show_bug.cgi?id=877038

The problem is that Apper first tries to remove the packages with allow_deps set to false. In the yum backend, that results in an error if there are packages depending on the package to remove. In the hif backend, allow_deps=false is not supported at all and ALWAYS results in an error.

This one-line fix:
http://pkgs.fedoraproject.org/cgit/apper.git/tree/apper-0.9.1-allow_deps.patch
makes it work for us. (The comment should probably be updated too, but… ;-) )
Comment 7 Aleix Pol 2015-10-28 01:21:00 UTC
Git commit 3c1cccdb7f9b0d53da3e2e22bfafe2cefd5fc577 by Aleix Pol.
Committed on 28/10/2015 at 01:16.
Pushed by apol into branch 'Plasma/5.4'.

Fix package removal on PackageKit

Allow PackageKit to remove dependencies if necessary. Shouldn't be a
problem.
Fixes removal in Fedora (see bugs attached) and Archlinux.
Related: bug 354415

M  +2    -1    libmuon/backends/PackageKitBackend/PKTransaction.cpp

http://commits.kde.org/muon/3c1cccdb7f9b0d53da3e2e22bfafe2cefd5fc577
Comment 8 Rex Dieter 2015-10-28 13:27:40 UTC
Git commit cc472bd1e3da2f79059e2e30e021d36f4f2b016a by Rex Dieter.
Committed on 28/10/2015 at 13:27.
Pushed by rdieter into branch 'master'.

handle dependencies on package removal

M  +1    -1    libapper/PkTransaction.cpp

http://commits.kde.org/apper/cc472bd1e3da2f79059e2e30e021d36f4f2b016a