Bug 189483 - yum should clean only packages which it really installed when keepcache=0
yum should clean only packages which it really installed when keepcache=0
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-20 09:14 EDT by Adam Pribyl
Modified: 2014-01-21 17:54 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-25 10:32:01 EDT
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 Adam Pribyl 2006-04-20 09:14:35 EDT
Description of problem:
In FC5 there is by default set keepcache=0 and yum wipes the complete cache when
it succesfully finishes ANY job. This result is situation like this:
1. yum update (you download lot of updates e.g. 500MB), on transaction test you
end up with some kind of error or you cancel the operation. Yum keeps the cache.
2. You decide at least to update kernel. Using yum update kernel wipes complete
cache as this operation was successful.

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

How reproducible:
Always

Steps to Reproduce:
1. yum update
2. cancel the operation after you download all updates
3. yum install <whatever>
  
Actual results:
Complete cache is cleaned.

Expected results:
Only those package that really were installed should be deleted when keepcache=0.

Additional info:
Comment 1 n0dalus 2006-07-13 01:47:03 EDT
This happens to me with yum-2.6.1-0.fc5. Very annoying feature.

Relevant code is in __init__.py:

    def runTransaction(self, cb):
        """takes an rpm callback object, performs the transaction"""
[...]
        if errors:
            raise Errors.YumBaseError, errors

        if not self.conf.keepcache:
            self.cleanHeaders()
            self.cleanPackages()
[...]
    def cleanPackages(self):
[...]
        for repo in self.repos.listEnabled():
            repo.dirSetup()
            path = repo.pkgdir
            filelist = misc.getFileList(path, ext, filelist)

        for pkg in filelist:
            try:
                os.unlink(pkg)

In other words, any successful transaction calls cleanPackages and cleanHeaders,
which in turn unlink every file in the 'pkgdir's and 'hdrdir's respectively.
Comment 2 Horst H. von Brand 2006-07-13 21:43:03 EDT
A simple way to get this:

- Install some old i386 package on x86_64
- Upgrade to the x86_64 version

The result is a file conflict, and yum fails.

This happened in rawhide with OOo and lately with xfce from the xfce44beta repo
Comment 3 Jeremy Katz 2006-07-25 10:32:01 EDT
Patch committed upstream, will be in 2.9.4

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