In a desperate attempt to squeeze a little more diskspace for my choked server I wrote a script which examines all the packages on the box to see which ones aren't required by any others. I figured these "top leaves" can be removed if I know I'm not using them. The script basically does a "rpm -q --provides" for a package, then for each provided capability, it does a "rpm -q --whatrequires". The packages which provides capabilities which aren't required by anything else are the ones I want. During this process I came across tcsh, which I don't use. It doesn't provide much:
rpm -q --provides tcsh tcsh
and nothing uses that:
rpm -q --whatrequires tcsh no package requires tcsh
Ha! 2MB to be saved here! But: # rpm --erase tcsh error: removing these packages would break dependencies: /bin/csh is needed by transfig-3.2.3d-219 /bin/csh is needed by samba-2.2.5-124 Oh. A check confirms:
rpm -q --whatprovides /bin/csh tcsh-6.12.00-40
Now I'm confused. The "--provides" operation on tcsh doesn't say it provides "/bin/csh", but the "--whatprovides" operation on the file says it does. Why the inconsistency? I'm no expert on RPM. What have I misunderstood? --
eatapple core dump
The 03.08.04 at 10:34, Derek Fountain wrote:
Why the inconsistency? I'm no expert on RPM. What have I misunderstood?
Maybe you will have to modify your script, so that it tries to unistall with the "--test" option, before flagging an rpm as erasable. -- Cheers, Carlos Robinson
On Mon, Aug 04, 2003 at 03:52:10PM +0200, Carlos E. R. wrote:
The 03.08.04 at 10:34, Derek Fountain wrote:
Why the inconsistency? I'm no expert on RPM. What have I misunderstood?
I was going to try and explain my take on it, but deleted it again. I guess it means that even if I can't explain it, I still think it does make kind of sense. man rpm
Maybe you will have to modify your script, so that it tries to unistall with the "--test" option, before flagging an rpm as erasable.
Which is how I did it. I have a script which does more or less exactly what you want. It's bloated, ugly, slow and ...well... let's just say I'm not a very experienced scripter. Actually it's two scripts: One builds a list of all package names, on the system, but without version numbers. Then it runs two tests on the packages found rpm -e --test $EACH rpm -q --whatrequires $EACH Results are put in some other files, which are then crosschecked using another script. Neither of the scripts ever got very polished, because I started translating the main script from bash to perl, and then got ambitious and then distracted :-P AFAICT they basically work, meaning that the resulting list of rpms does indeed seem like the 'toplevel' ones If you're interested, drop me a line offlist, and I'll tar them up HTH Jon Clausen -- Whatever rocks your boat!
On Monday 04 August 2003 21:52, Carlos E. R. wrote:
The 03.08.04 at 10:34, Derek Fountain wrote:
Why the inconsistency? I'm no expert on RPM. What have I misunderstood?
Maybe you will have to modify your script, so that it tries to unistall with the "--test" option, before flagging an rpm as erasable.
That's a good idea. I never thought of that. :o) --
eatapple core dump
participants (3)
-
Carlos E. R.
-
Derek Fountain
-
Jon Clausen