Bug 331730 - Muon cannot uninstall/purge packages with dependencies. Synaptic removes them just fine.
Summary: Muon cannot uninstall/purge packages with dependencies. Synaptic removes them...
Status: RESOLVED WORKSFORME
Alias: None
Product: muon
Classification: Applications
Component: muon (show other bugs)
Version: 2.2.0
Platform: Kubuntu Linux
: NOR major
Target Milestone: ---
Assignee: Jonathan Thomas
URL: http://goo.gl/ffgVYq
Keywords: triaged
: 333673 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-03-04 12:25 UTC by Fabio Correa
Modified: 2018-10-27 04:07 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
reset the flag to show the problem (1.34 KB, patch)
2016-01-15 16:19 UTC, Carlo Vanini
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Correa 2014-03-04 12:25:27 UTC
Since I upgraded to Kubuntu 14.04, I have seen that Muon refuses to uninstall/purge packages without justification. The error message is:

"The -pack- package could not be marked for installation or upgrade"

Synaptic is able to remove said packages just fine.

Reproducible: Always

Steps to Reproduce:
1. Open muon and select a mark of packages for uninstall/purge. One of the following examples may work for you: kdepimlibs-kio-plugins, kdevelop-l10n, kdevelop-php-l10n, gnuplot-qt, uno-libs3. The error message should appear.
2. Close muon and run synaptic.
3. Mark the package for removal/purge.
Actual Results:  
Muon fails to mark the packages for removal/purge, while Synaptic marks them.

Expected Results:  
Muon to resolve dependencies and ask me whether I want to uninstall dependencies as well.
Comment 1 Fabio Correa 2014-04-12 15:12:38 UTC
This bug persists on 2.2.0 on KDE 4.13.
Comment 2 Victor Varvaryuk 2014-06-15 15:28:03 UTC
A duplicate: https://bugs.kde.org/show_bug.cgi?id=333673
Comment 3 Martin Tlustos 2014-06-30 11:36:38 UTC
Same here.
Comment 4 Saurav Sengupta 2014-07-14 09:45:07 UTC
Same problem. apt-get works correctly.
Comment 5 Harald Sitter 2014-07-14 09:47:35 UTC
I think(tm) I fixed this bug the other week in qapt git, if anyone wants to build master and try that would be really great.
Comment 6 Victor Varvaryuk 2014-09-03 05:19:28 UTC
I received updates in Kubuntu:
libqapt (2.1.70-0ubuntu4.2) trusty; urgency=medium

  * Add upstream_fix-package-remove-resolver.diff LP: #1358291
    ensure package resolution happens after cache is marked

Installed them and restarted the computer. The problem still persists.
Comment 7 Harald Sitter 2014-09-03 07:08:41 UTC
Please check that the test case here: https://bugs.launchpad.net/ubuntu/+source/libqapt/+bug/1358291/comments/2 is what you experience and whether the test case actually succeeds with the patched version.
Comment 8 Victor Varvaryuk 2014-09-03 07:14:51 UTC
Ok, sometimes it works, sometimes not: http://www.youtube.com/watch?v=E_3O01iNlw0
Comment 9 Harald Sitter 2014-09-03 07:22:35 UTC
Does it always fail for bluez-alsa? (i.e. would it fail if you try to remove it right after starting muon?) If not please file a new bug because what you are seeing is the cache getting confused.
Comment 10 Aleix Pol 2015-01-15 15:44:42 UTC
*** Bug 333673 has been marked as a duplicate of this bug. ***
Comment 11 Victor Varvaryuk 2015-01-15 21:46:54 UTC
The problem still exists in the same way as here: http://www.youtube.com/watch?v=E_3O01iNlw0

1. Open Muon and fiter packages by "Installed" status
2. Select a package that other packages depend on (for example in my Kubuntu 14.10 I selected package `baloo` on which package `baloo4` depends). Right click -> "Mark for removal"
3. Click "Unmark all"
4. Select package `baloo4` (the one that depends on the package you just tried to remove).  Right click -> "Mark for removal"
5. You get a popup window with this message: "The "baloo4" package could not be marked for installation or upgrade:"
Comment 12 Carlo Vanini 2016-01-15 16:19:10 UTC
Created attachment 96661 [details]
reset the flag to show the problem

I was able to reproduce the bug as described by Victor with the packages "aptitude" and its dependency "aptitude-common", and will use them as an example in the discussion below.

* We start with both packages installed.
* By requesting the removal of "aptitude", Package::setRemove() (in libqapt) will try to resolve any dependency problem arising. To do this it also calls pkgProblemResolver::Protect() (in libapt-pkg).
This causes "aptitude" to be marked as "Protected" in the depCache.
* When unmarking "aptitude" muon uses Package::setKeep() to unmark the package.
* When we try to remove "aptitude-common" Package::setRemove() uses pkgProblemResolver again to resolve dependences. But apparently the resolver will not touch "aptitude" because the "Protected" flag is still in place.

I attach a patch *against libqapt* to prove the concept, but it is a hacky workaround. It changes what should be an internal flag of apt-pkg. On the other hand I see no other way to change it.
Does the resolver really need that flag in the cache?

A different point is, why does the error message give no reason?
The dialog box is shown because the depCache correctly reports 1 broken package, i.e. "aptitude". But Package::brokenReason() is called on "aptitude-common", which has no reason to be broken.
Is this a bug too? not sure.
Comment 13 Andrew Crouthamel 2018-09-25 21:55:58 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 14 Andrew Crouthamel 2018-10-27 04:07:59 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!