Red Hat Bugzilla – Bug 467225
feature request for RPM
Last modified: 2009-07-28 07:34:07 EDT
Description of problem:
Whenever you are going to uninstall (with YUM) some applications installed (by YUM), it won't uninstall unused dependencies. So the uninstallation process isn't complete; it isn't a full rollback as you would expect.
The "package-cleanup" tool inside "yum-utils" is useful to find and later manually remove unused libs, but it isn't reliable. It's because having no dependencies doesn't mean that the installed packages is useless. SO, if you are going to type "package-cleanup --leaves --all" you'll see in that list also useful application you want to keep (like filezilla, openoffice, and many other).
I've suggested a solution ( http://forums.fedoraforum.org/showpost.php?p=1097145&postcount=5 ) but i don't know if it's possible.
I was thinking about insert for each installed package one more flag, called "EndUserApplication" (or whatever is the name you like) to point out if that package is a end-user application (like openoffice-base) or a dependency.
In this way, it would be a lot simple to remove unused (but installed) packages, without having to fear and to check if any of those packages is a end-user app or if it's a no-more useful dependency.
You would have in any package that new flag, for example in any end-user application "EndUserApplication: yes" and in any dependency package of that application "EndUserApplication: no", so when you are going to remove the main software (the real end-user application) you ca also remove all the unused dependencies, if they have the flag "EndUserApplication" set to "no". In this way you know that you are free to remove them too!
For backward compatibility, you cold have another flag value ("EndUserApplication: unknown") used by default for old RPMs without the "EndUserApplication" flag set neither to "yes" or "no". In this way, the behavior of YUM must be the same of "EndUserApplication: yes" to avoid problems.
I know you will have to change how YUM&RPMs work and the .spec files of any RPM package; but i think that it would be a useful feature and it may deserve that effort.
How do you differentiate tools such as xmlstarlet which could be both an end-user tool *and* an intermediate dependency?
I'll second the motion: I've often desired a way to cull unnecessary packages
without removing potentially useful stuff that has no hard deps, but which if
removed might cripple other apps and/or reduce their features/capabilities. In
particular, as the OP suggests: how to remove unneeded deps dragged in by
installation of one package, which is then quickly removed, leaving a pile of
"useless" packages in it's wake? Could RPM as it exists possibly sort out "soft
deps" and list packages whose removal would impact the functionality of other
packages, without necessarily crippling them/violating hard dep requirements?
@Ignacio Vazquez-Abrams: That's what we're asking you!!!
Sorry Ignacio if i can't talk about "xmlstarlet", but i just don't know what is it :-/
I'll make another example, i hope you were talking about this anyway...
(if i'm not wrong)In Fedora 7, "curl" (one utility to download files...) was in only one package.
In Fedora 9, curl was in two packages called: "curl" and "libcurl".
The first with the manual and the executable file; the second with the libs.
If packages are created in a good way (like curl for F9), it's simple to uninstall "curl" (EndUserApplication:yes) but keeping "libcurl" (EndUserApplication:no) IF other software rely on "libcurl" (because you can check it).
If you remove all the software that have dependencies on "libcurl": because libcurl is set with "EndUserApplication:no" you can uninstall libcurl too (as it's not necessary anymore)!
What if some software is rely on "curl"--the end user application?
Simple, as that software has a dependency-links to "curl", then you cannot remove "curl" nor "libcurl" without removing also the others applications (as you know, right now; yum will remove any software that depends on all the packages you are going to remove)
Sorry, nevermind: yum-remove-with-leaves is the plugin we're looking for, so it seems to already exist.
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.
More information and reason for this action is here:
Ok. After a long test with "yum-remove-with-leaves", i feel free to say that (unlucky) "yum-remove-with-leaves" is more similar to a virus than to what i was talking about as that yum plugin wants to destroy your system at each update.
Re: comment #1
You differentiate by looking at dynamic usage statistics such as st->st_atime
for all files in a package to determine whether any file within a package has been
recently used. Yes noatime on a mount point forces other metrics than st->st_atime
to be used instead. Any metric related to whether a file within a package has
been recently used will work if st->st_atime updating is disabled.
What works rather poorly is to attempt to remove package leaf nodes in the dependency
graph blindly. Better metrics, even installtime, are better hints to "unused" than
the fact that a package is a leaf node because there are often missing, implicit,
dependencies because of poor packaging, that cause packages to appear to be
leaf nodes when they are not.
Hello Bug Zapper,
Since this is a feature request (explicitly named) and according to http://fedoraproject.org/wiki/BugZappers/HouseKeeping
This bug report should not have been rebased from rawhide to F10.
Instead the bug may have been setup wrong and should be changed to enhancement instead of bug ...
so i'll close it!
Bee!!! -- http://honeybeenet.altervista.org/beesu/