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.
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".
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.
> 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.
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.
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.
*** This bug has been marked as a duplicate of 2938 ***