Bug 479907 - FutureFeature: Ability to purge package cache rather than just clean.
FutureFeature: Ability to purge package cache rather than just clean.
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
10
All Linux
low Severity low
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-13 18:19 EST by DaveG
Modified: 2014-01-21 18:07 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-14 08:53:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description DaveG 2009-01-13 18:19:04 EST
Description of problem:

FutureFeature - yum
=============

keepcache=1 is useful when removing and installing packages but cache storage grows unconfined. `yum clean packages` is no more useful than `rm -f /var/cache/yum/*/packages/*`. All or nothing.

A "really useful" enhancement would be the ability to clean, but keep the newest 'n' packages, i.e. purge the package cache. e.g.
  yum [purge|clean] --keep=[n]

Ideal candidate for a weekly or monthly cron job.

Version-Release number of selected component (if applicable):
Currently yum-3.2.20-5
How reproducible:
N/A.
Steps to Reproduce:
N/A.
Actual results:
N/A.
Expected results:
N/A.
Additional info:

I have written a utility to perform this task but it's stand-alone and in Perl. Over the life of Fedora 8 it has freed over 2GB of space while keeping the latest versions available.
Let me know if you want a copy - it describes the issue/solution quite well.

Cheers,
--DaveG.
Comment 1 seth vidal 2009-01-13 22:10:26 EST
you can use repomanage for this:

repomanage -k n -o /var/cache/yum | xargs rm -f

repomanage is in yum-utils
Comment 2 seth vidal 2009-01-14 08:53:36 EST
Since we have a way to do this and we have lots of ways of making local mirrors, I think I'm going to pass on implementing this inside yum itself.

thanks

Note You need to log in before you can comment on or make changes to this bug.