[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: yum cleanup

Todd Denniston wrote:
Bill Davidsen wrote, On 07/25/2009 08:32 PM:
I have been running yum with keepcache=1 to save rpms I install. Being busy I seem to have gotten several versions of some packages in /var/cache/yum. Is there a command which will delete anything listed in obsoletes without losing my copy of the most recent? I create a local archive of recent rpms to be nice to my network.

Using 'yum clean' does too much. :-(

repomanage -c -k 2 --old path/to/cacheOfRPMs/ > removethese.txt
#and then (after sanity checking removethese.txt)
for i in `cat removethese.txt`;do rm $i;done

might get you close.
Note, AFAIK the repomanage command does NOT have to be ran against a YUM repo.

Note 2, using -k 1 keeps 1 vs -k 2 keeping 2.

I can't thank you enough for that, I was looking in all the wrong places! Just the solution I wanted, works perfectly.

Bill Davidsen <davidsen tmr com>
  "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]