[softwaremgmt] software manager: provide aid in removing unused libraries (uninstall)
Hello, Originally posted here: https://bugzilla.novell.com/show_bug.cgi?id=329018 This is typical situation, I install app A but it requires library L. I install both, then it appears I don't need A anymore, so I remove it, but I have no clue what to remove too. From user point of view, it would be great to click on "check for unused software" and SM would show list of unused libraries, so user could easily remove them. Technically I can imagine it could be done by building reverse dependency tree and show all leaves. The drawback of such approach would be in including main apps too :-) Maybe it could be solved by checking if: 1) there is an executable in the package 2) any of the files in the package were accessed lately 3) did user install it explictly or it was SM call (fullfilling requirements) have a nice day, bye -- Maciej Pilichowski -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maciej Pilichowski wrote: [...]
Technically I can imagine it could be done by building reverse dependency tree and show all leaves. The drawback of such approach would be in including main apps too :-) Maybe it could be solved by checking if: 1) there is an executable in the package
/usr/bin/foo-config is an executable too, but it's only in -devel packages, so that's already an exception.
2) any of the files in the package were accessed lately
That's going to be very expensive to compute (or rather, very time-consuming and lots of I/O).
3) did user install it explictly or it was SM call (fullfilling requirements)
It must be tracked by the package manager because RPM won't tell you. And then you get into the problem that it would only work if the user always uses yast (or maybe it could be done in libzypp). If he uses "rpm -i" or smart or yum or whatever else just once, it won't be tracked. IMO point 3) is not feasible. And the problem in the first place is that you can't just use "rpm - --whatrequires" to find out whether a package is needed or not, because rpm only reports Requires: with package names there. But must of the dependencies are on filenames (e.g. "libxml2.so.2" or "/bin/bash"). As an example, take libxml2. It's not sufficient to do $ rpm -q --whatrequires libxml2 You must also list all Provides of that package: $ rpm -q --provides libxml2 libxml2.so.2()(64bit) libxml2 = 2.6.26-26 and then apply some fuzzy logic to also do $ rpm -q --whatrequires 'libxml2.so.2()(64bit)' And that's just for shared libs. So.. certainly feasible in theory but not as simple as it might seem. cheers - -- -o) Pascal Bleser http://linux01.gwdg.de/~pbleser/ /\\ <pascal.bleser@skynet.be> <guru@unixtech.be> _\_v The more things change, the more they stay insane. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFG/3Pur3NMWliFcXcRAsJgAJ4scE520B9AxTeZL4bg6BDmO637QgCgmyto vILMhTNbUMLciclLQb9XHUQ= =C9Hi -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
Hello,
3) did user install it explictly or it was SM call (fullfilling requirements) It must be tracked by the package manager because RPM won't tell you.
True, but this could be used to assign "points" to each package. Points would be used to show sorted list of unused packages. That way top packages would be libraries, at bottom you would find applications.
And then you get into the problem that it would only work if the user always uses yast (or maybe it could be done in libzypp). If he uses "rpm -i" or smart or yum or whatever else just once, it won't be tracked. IMO point 3) is not feasible.
Here I differ in opinion, if you use rpm you are likely not a regular user, so seeing list: OpenOffice libsomething you should also easily judge if it is a library or an app.
And the problem in the first place is that you can't just use "rpm --whatrequires" to find out whether a package is needed or not, because rpm only reports Requires: with package names there. But must of the dependencies are on filenames (e.g. "libxml2.so.2" or "/bin/bash").
Yes, it could be time consuming. But the good news it is possible. It could be option not to check the whole system but to examine "suspicious" package if it is still required -- this would be also useful. have a nice day, bye -- Maciej Pilichowski -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Maciej Pilichowski wrote:
3) did user install it explictly or it was SM call (fullfilling requirements) It must be tracked by the package manager because RPM won't tell you.
True, but this could be used to assign "points" to each package. Points would be used to show sorted list of unused packages. That way top packages would be libraries, at bottom you would find applications.
Mmm.. a scoring system... that's likely to cause harm though. If it's constrained to libraries, then it might work, but for non-library or non-devel packages, I'm not sure whether it's a good idea. And never removing packages from a "System/*" %GROUP is probably needed too.
And then you get into the problem that it would only work if the user always uses yast (or maybe it could be done in libzypp). If he uses "rpm -i" or smart or yum or whatever else just once, it won't be tracked. IMO point 3) is not feasible. Here I differ in opinion, if you use rpm you are likely not a regular user,
That's plain wrong. The package manager doesn't always do what you'd need and there are some tutorials that explain how to get things done by using rpm directly. You cannot just discard that case because no one is going to do it.
so seeing list: OpenOffice libsomething you should also easily judge if it is a library or an app.
Yes, as long as it follows the new Shared Library Policy that was introduced in 10.3, which is the case for most packages (but not all) -- at least if you're only looking at the package name (^lib).
And the problem in the first place is that you can't just use "rpm --whatrequires" to find out whether a package is needed or not, because rpm only reports Requires: with package names there. But must of the dependencies are on filenames (e.g. "libxml2.so.2" or "/bin/bash").
Yes, it could be time consuming. But the good news it is possible. It could be option not to check the whole system but to examine "suspicious" package if it is still required -- this would be also useful.
I don't know. My point is: either it works reliably, with 100% accuracy (i.e. don't remove needed packages), or just don't do it at all because it's likely to cause more harm than good. cheers - -- -o) Pascal Bleser http://linux01.gwdg.de/~pbleser/ /\\ <pascal.bleser@skynet.be> <guru@unixtech.be> _\_v The more things change, the more they stay insane. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFG/47xr3NMWliFcXcRAqv6AKC4s3O/EIBBURjS/HqwJjNgy+mC6QCfWLVB 5fN1Q0TtBGRkh2ZzbaazpZg= =CQUL -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
Hi,
I don't know. My point is: either it works reliably, with 100% accuracy (i.e. don't remove needed packages), or just don't do it at all because it's likely to cause more harm than good.
Misunderstanding -- it won't remove anything. It should only _list_ packages with no references, that's it. I only suggested some possibilities how to sort that so the libraries would go first, and applications last. But this is an improvement -- even bare list would be very helpful. And what's important here -- you can prepare such list with 100% accuracy. Sorting -- I don't think so, but user would benefit even from small improvement in ordering. have a nice day, bye -- Maciej Pilichowski -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
Hello, on Sonntag, 30. September 2007, Pascal Bleser wrote:
It's not sufficient to do $ rpm -q --whatrequires libxml2 You must also list all Provides of that package: $ rpm -q --provides libxml2 libxml2.so.2()(64bit) libxml2 = 2.6.26-26 and then apply some fuzzy logic to also do $ rpm -q --whatrequires 'libxml2.so.2()(64bit)'
rpm -e --test libxml2 will list all dependencies ;-) - but make sure not to forget --test *g* About the idea in general: Such a feature could be useful, however it has some risks as Pascal already pointed out. Regards, Christian Boltz -- Coffee in the morning is a good thing.. Or what the hell, coffee around the clock is a good thing.. :) [Anders Norrbring] -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
* Pascal Bleser <pascal.bleser@skynet.be> [Sep 30. 2007 12:01]:
3) did user install it explictly or it was SM call (fullfilling requirements)
It must be tracked by the package manager because RPM won't tell you.
We're planning to add 'tracking' functionality to the package manager.
And then you get into the problem that it would only work if the user always uses yast (or maybe it could be done in libzypp). If he uses "rpm -i" or smart or yum or whatever else just once, it won't be tracked. IMO point 3) is not feasible.
Its certainly not a generic solution but doable within the mentioned limitations (i.e. use only yast / zypper )
And the problem in the first place is that you can't just use "rpm - --whatrequires" to find out whether a package is needed or not, because rpm only reports Requires: with package names there. But must of the dependencies are on filenames (e.g. "libxml2.so.2" or "/bin/bash").
Thats what the dependency solver is for ;-) [...]
So.. certainly feasible in theory but not as simple as it might seem.
Agreed, it ain't easy but certainly worth a try. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-softwaremgmt+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-softwaremgmt+help@opensuse.org
participants (4)
-
Christian Boltz
-
Klaus Kaempf
-
Maciej Pilichowski
-
Pascal Bleser