[CentOS] Cleaning up an RPM repository.

Friedrich Clausen fred at derf.nl
Wed Jan 7 16:14:08 UTC 2009


Thanks for the quick replies guys.

On Wed, Jan 7, 2009 at 4:54 PM, Greg Bailey <gbailey at lxpro.com> wrote:
> Hi,
> I've also faced this problem, and you're right:  relying on timestamps
> and/or sort order of the RPM filenames doesn't work.
> The best tool I've found is "repomanage.py" from the yum-utils package
> available at:
> http://yum.baseurl.org/download/yum-utils/
> Even though yum-utils claims it needs a newer version of yum than I
> usually have, I've run the repomanage.py script that's included without
> any problems.
> My typical use has been:
> repomanage.py -o RPMS | xargs rm -f
> where 'RPMS' is a directory with a whole mess of RPMs.  The
> repomanage.py script with '-o' as an argument spits out only obsoleted
> RPMs, so the above command removes all but the most recent version.
> I see that there's a '--keep' option that *might* do what you're looking
> for (keeping the last 3 or 4 versions), but I have not used this option
> before.

Ah, great, I will definitely give this a try tomorrow and report back.



More information about the CentOS mailing list