Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 32303 - A true "unmerge"
Summary: A true "unmerge"
Status: RESOLVED DUPLICATE of bug 2938
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-29 21:03 UTC by James Kyle
Modified: 2005-07-17 13:06 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Kyle 2003-10-29 21:03:46 UTC
It would be nice if portage could do a "true" unmerging of a package. For
example, if I emerge kde a fairly long list of packages is emerged. However if I
emerge -C kde only kde is unmerged leaving all the other packages.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 TGL 2003-10-30 07:27:40 UTC
What about "emerge depclean"? In case kde apps and libs were only
installed as "kde" dependencies, then they will be removed by the
depclean once you have unmerged "kde".
Comment 2 James Kyle 2003-10-30 11:01:35 UTC
Depclean is pretty "dirty", for example when I emerge -p depclean I see listed:
fluxbox, commonbox-utils, SSL, etc. Many of these were explicitly merged
too (which I find confusing that they would appear here). 
The implementation that I'm thinking of would be more along these lines.


I emerge kde. This emerges xx, yy, xy, and yx packages as a result. This
would be stored as the kde installed files. Thhan if I emerge -C kde, it
would unmerge kde, xx, yy, xy, and yx as well unless I xplicitly tell it
not to.
Comment 3 TGL 2003-10-31 07:58:33 UTC
> Depclean is pretty "dirty", for example when I emerge -p depclean I 
> see listed: fluxbox, commonbox-utils, SSL, etc. Many of these were 
> explicitly merged too (which I find confusing that they would appear 
> here). 

What does your world file say about this packages?

But it is true that depclean is not the perfect solution, for at least
two reasons: 

 - world file does not always reflect what the user has in mind, 
 because users are not portage-friendly: they sometimes install things
 with ebuild instead of emerge, or they install an xmms-plugin thinking
 "portage will take care of also installing xmms", and months later 
 uninstall the plugin and then wonder why depclean want to remove xmms 
 whereas they use it daily...

 - It may break things, as stated in the big warning.

> I emerge kde. This emerges xx, yy, xy, and yx packages as a result. 
> This would be stored as the kde installed files. Thhan if I emerge 
> -C kde, it would unmerge kde, xx, yy, xy, and yx as well unless I 
> xplicitly tell it not to.

No, kde libs can also satisfy deps of package you've installed later.
I've installed xfree and perl as dependencies of frozzen-bubble, that 
doesn't mean I want them uninstalled now that I've switched to 
monkey-bubbles :)

A correct handling of your "deep unmerge" feature requires a real
reverse dependencies checking mechanism, which is far from easy 
to implement (considering it has to be efficient but also to take 
portage specificities like use flags into account).

Then, once this mechanism is ready, implementing a better depclean 
or your "deep unmerge" becomes easy. I prefer the depclean approach,
because it is less error prone from a user point of view (you only
unmerge "unnecessary" packages the day you have really decided it 
was time for some big cleanups, and so you watch what you are doing).
But both solutions are valid though, it's really a matter of interface
and should give equivalent results.
Comment 4 James Kyle 2003-10-31 12:31:33 UTC
Currently I do use depclean. I uninstall all packages I don't immediately
recognize and than re emerge if something complains (like suggested in the
warning before depclean does it's job). I do understand the inherent difficulty
involved, perhaps it is something I can work on myself if my skilz reach
that level.

Thank you for taking the time to reply.
Comment 5 John Nilsson 2003-12-06 01:05:31 UTC
Not entierly related. But on topic =) What about package remains?

Many times after unmerging a package files that is no longer needed is left behind. sometimes these files cause trouble. Mostly /etc/init.d and /etc/runlevels/default will be the cause of trouble but even ~/.package can be troublesome. I even remember an incident where I had to unmerge a packge because it was a nonworking autodetected dependency. But the autodetection of the other package still detected the unmerged package.

What would be nice is an option to completely wipe all traces of the package.

The problems is: 
1. Protection mechanism
   Files that are alterd since install will not be removed (!MTIME)
   Files in /etc/ will not be removed because of $CONFIG_PROTECT
2. Ignorance
   Files are created in relation to the package after emerge. Thus, portage has
   no record of them.
3. Policy
   Files shouldn't be removed from ~/ as user might get upset.

Solution:
   emerge ultraclean
   Verify all files in the system against the portage databse, those not
   acounted for should be moved to a tar.gz.
Comment 6 Brian Harring (RETIRED) gentoo-dev 2004-08-10 22:43:31 UTC

*** This bug has been marked as a duplicate of 2938 ***