Ask Your Question

Clean up PackageKit cache the right way

asked 2017-07-24 06:47:31 -0500

techtonik gravatar image

image description

Is there a proper way to clean up old PackageKit caches without resorting to low level sudo rm -rf /var/cache/PackageKit/2[3-4]. I would like PackageKit to take care about itself cleaning files like indexes that may be left in other dirs.

edit retag flag offensive close merge delete


Here is a related bug report: link

florian gravatar imageflorian ( 2018-03-07 10:29:56 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2017-07-24 09:49:46 -0500

florian gravatar image

updated 2018-03-07 10:28:31 -0500

I've briefly read through man pkcon, and PackageKit does not seem to provide a command to clear the cache. I think, you already got the best command to clear the cache. If you don't use Gnome Software/PackageKit, just disable (mask) the service.

EDIT: Another method is to tell PackageKit not to cache (store) packages - there is a setting in /etc/PackageKit/PackageKit.conf: uncomment #KeepCache=false (to make it look like: KeepCache=false)

And if you use dnf to update, you tell PackageKit not to download any updates automatically:

gsettings set download-updates false
edit flag offensive delete link more

answered 2017-10-08 10:01:10 -0500

fednucsun gravatar image

At least on Fedora 26, I found that pkcon refresh force cleared out PackageKit-cached RPMs that were from currently-enabled repositories and had already been installed elsewhere (e.g. via DNF).

There were a few additional cached RPMs remaining for disabled repos that I'd used in the past (e.g. updates-testing); for these I used pkcon repo-enable repo-name, then pkcon refresh force, then pkcon repo-disable repo-name.

edit flag offensive delete link more


This command removed 16GB from cache and got fedora-root down from 96% to 40%. Thanks!

MarieDK gravatar imageMarieDK ( 2018-06-19 04:19:43 -0500 )edit

This is did the trick wonderfully. Thank you @fednucsun!

packetpenguin gravatar imagepacketpenguin ( 2018-11-30 11:33:41 -0500 )edit

Question Tools

1 follower


Asked: 2017-07-24 06:47:31 -0500

Seen: 22,982 times

Last updated: Mar 07 '18