Description of problem:
DNF leaves behind a lot of packages that take up space on the system.
It doesn't seem to be cleaning up after itself. This may have to do with it automatically downloading updates and then the user either manually updating (me) or infrequently updating (my wife)
Version-Release number of selected component (if applicable):
dnf-2.7.5-2.fc27.noarch currently, but this has been an issue for some time.
Steps to Reproduce:
1. Run a fedora system for some time.
2. Run du -h on /var/cache/PackageKit
I've seen a range of issues (over a number of upgrades of fedora)
Here's some of them:
1. The system won't upgrade complaining that there's not enough space. Checking /var/cache/PackageKit shows an enormous amount of old packages, often in versions that haven't been used for some time. For example, my wife tried to run yum update recently and it failed complaining about space. On checking I found cached packages from fedora 24, 25, 26 and 27 (of which she's currently on 27). Deleting the folders for 24, 25 and 26 solved the issue and didn't seem to have any unexpected outcomes. I've had to do this on a number of systems to resolve space issues.
2. I have over 2700 packages in /var/cache/PackageKit/27/metadata/updates/packages/ but my system is currently up to date. These packages are taking up 6.1G of my filesystem.
It appears that dnf is downloading the 'current' update for a package but doesn't delete older, unneeded 'updates' that weren't acted up.
I would expect two things:
Firstly, if dnf is to download updates automatically it needs to check if older versions have been downloaded and then remove them (or at least delete all older versions when the packages are updated.
Secondly, dnf should remove traces of older versions of fedora when updating. There doesn't appear to be a need to keep a copy of the older versions cached files on update, and it's unclear why packages and metadata for version 24 are hanging around when you're running 27 (and have updated through all three versions.)
As my wife said, this isn't a mere mortal moment is it (as I had to manually update her system) and she's right.
I've seen to problem a lot, so I apologize for the tardiness of the bug report.
I've filed this as urgent as we are about to enter another update from 27 to 28 and this is likely to affect more users than last time.
This is PackageKit's cache. Dnf has a cache in /var/cache/dnf. Reassigning.
should be (mostly) resolved after updating to PK-1.1.9 , see also
and bug #1306992
*** This bug has been marked as a duplicate of bug 1306992 ***