Offline Repo Cleanup

Posted on

So I just inherited a YUM repo which we update via sneaker-net monthly. As I was looking at it I noticed RPM versions from way back. For example, there must be 12 kernel RPMs. Then there are also multiple versions of all sorts of packages which have been superseded by updates.

Is there a way to safely remove older RPMs, say keeping the last 3 or so versions, while you still ensure you preserve the dependencies. My mind is rolling through the scripting possibility here, but if someone has already traveled this path I sure would like know how you solved it.

Kind regards and thanks.

Responses