Bug 486555 - Need to be able to clean/disable yum cache
Need to be able to clean/disable yum cache
Product: Fedora Hosted Projects
Classification: Retired
Component: mock (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Clark Williams
Depends On:
  Show dependency treegraph
Reported: 2009-02-20 04:49 EST by Richard W.M. Jones
Modified: 2013-01-10 00:04 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-08-03 18:44:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2009-02-20 04:49:55 EST
Description of problem:

Mock (and yum in general) has an annoying habit of caching repository state,
and not doing a trivial 'HTTP HEAD' request to find out if its cache needs to be

This is particularly a problem for smock because we rerun 'createrepo' between
each run of mock, but the yum inside the mock keeps getting the old state of
the repository.

It appears that the cache is stored in /var/lib/mock/cache/.../yum_cache/
Unfortunately it is owned by root and so a simple 'rm -r' fails for us.

Therefore we need a mock command to blow away this cache.  For smock it
is not useful since the webserver runs on localhost so it's just as easy to fetch
the repodata and RPMs each time.

Version-Release number of selected component (if applicable):


How reproducible:

About 50% of the time.

Steps to Reproduce:
1. Run mock
2. Run createrepo on some repo used by mock
3. Run mock again
4. Observe that sometimes old repodata is used
Comment 1 Richard W.M. Jones 2009-02-20 05:09:48 EST
There seems to be a second cache here:
Different from the first one, also needs to be rm -rf'd
Comment 2 Clark Williams 2009-02-20 10:00:40 EST
mock 0.9.14 changed the mock cache directory from /var/lib/mock/cache to /var/cache/mock. The /var/lib/mock/cache dir needs to be whacked entirely. 

I'm not sure what mock can do about the repodata. We use yum for any access to repositories.
Comment 3 Clark Williams 2010-08-03 18:20:48 EDT
mock-1.1.3 coming out with --scrub option which allows you to clean the yum cache.
Comment 4 Fedora Update System 2010-08-07 19:23:38 EDT
mock-1.1.3-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

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