On Mon, Feb 17, 2003 at 07:31:13PM -0600, Jeric wrote:
On Mon, 2003-02-17 at 18:16, Fabian wrote:
<snip>
Instead I'm looking for packages that no other packages depend on. That means they can be uninstalled without breaking dependencies. Since rpm checks dependencies when packages are installed and uninstalled the needed information should already be in the rpm-database.
It does. The issue is extracting that info :)
A script should be able to perform this.
Indeed.
wow, I didn't realize that YaST has been leaving orphaned files behind until this thread...
Methinks the issue is more one of 'orphaned' *packages*, than one of 'orphaned' *files*. Usually removing a *package* should remove all the files that it originally installed.
I have MANY things that have been left behind from when I just "try" certain packages out.
Well it's a complicated issue, and I think the best that could be hoped for was for YaST to be able to come up with potential *candidates* for removal. Package dependencies are all well and good, but they simply don't tell the whole story. Take eterm f.x: jon@a13:~> rpm -q --whatrequires eterm no package requires eterm -but I might've manually set up something to run in eterm, and thus removing it, just on the grounds that no other *package* depends on it, would break this.
OK, a script can do this, here is what I was thinking:
<snip> Well, I was thinking (this is just thoughts, mind you) something to the effect of: Get a list of all known packages on the system, ignoring the version info; rpm -qa --queryformat '%{NAME}\n' > all_rpms then loop over this list, querying each package; for EACH in all_rpms ; do rpm -q --whatrequires $EACH done -or something... I don't know... maybe make a 'secondary' and possibly even a 'tertiary' list, to eventually come up with a list of packages that don't *seem* to be needed. One might feed that to rpm -e --test $CANDIDATES and watch the output, and *then*, finally, make decisions whether to actually go through with removal... I just found this great piece: http://www.rpm.org/max-rpm/s1-rpm-query-parts.html Have a look at the section "--requires: Display Capabilities Required by the Package" (around halfway down) I dunno, but it would be a nice script to have around... I find it hard to believe it's not already been invented? Jon Clausen