I noticed that the folder referenced in the subject line is taking up 1.5 GB. Can I run the below to clear it without causing permanent damage to my system?

rm -rf /var/cache/PackageKit/metadata/updates/packages/*

7 Answers 7


From the discussion in the bug linked in Daniel Bruno's answer .. you can get rid of these files using PackageKit console client pkcon

$ sudo pkcon refresh force -c -1

It takes some time but is provided by PackageKit itself. (and you may set a cron job for it)

from the man page of pkcon(1)

   refresh [force]
       Refresh the cached information about available updates.


   -c, --cache-age AGE
       Set the maximum acceptable age for cached metadata, in seconds. Use -1 for 'never'.

So this tells PackageKit to delete cached information (refresh cached information with maximum acceptable age of : never)

References :

  • 1
    What does this command do? Jul 14, 2016 at 10:37
  • 1
    @anatoly Answer updated to show a basic description of command from man page pkcon(1) Jul 26, 2016 at 13:37
  • 1
    @erik edited to show reference links Sep 8, 2016 at 13:25
  • 2
    So I ran the command in the answer and it chugged away for awhile but I was still left with over 3.5 GB used in my /var/cache/PackageKit directory. What am I missing? Jan 21, 2017 at 14:44
  • 5
    The pkcon command as given will not remove downloaded packages that have been cached. The problem is worse if you have a system that has been through multiple upgrades of the OS. In my case I've gone from Fedora 23->24->25. I've also used dnf quite a bit too. I have 3 additional directories (23, 24, 25)) under the /var/cache/PackageKit that all contain rpm files. I think my only real option here is manual deletion at this point. Jan 21, 2017 at 15:01

PackageKit is used by GNOME. If you use Yum or DNF on the CLI then don't need these. You can remove the .rpm files in /var/cache/PackageKit/metadata/updates/packages and set PackageKit to not store them any longer.

There is a setting in the file /etc/PackageKit/PackageKit.conf

# Keep the packages after they have been downloaded

As root, remove the hash mark on this configuration option and the packages will not be saved.

  • 3
    If you have upgraded from previous release of the OS, like Fedora 23->24->25 you'll also need to delete RPMs in numbered cache directory like these: /var/cache/PackageKit/24 /var/cache/PackageKit/23 /var/cache/PackageKit/25 Jan 21, 2017 at 15:07
  • 1
    The idea seems to come from this comment on the fedora mailing list. But it is not effective, i.e. my /var/cache/PackageKit directory is still growing. That means: Does not work neither on Fedora 24, and as of Thomas Mueller, nor on Fedora 25.
    – erik
    Jan 22, 2017 at 8:23

Yes, you can safely remove these packages. These packages are only used as cache by Packagekit.

Ref: https://bugs.freedesktop.org/show_bug.cgi?id=80053

  • 1
    See this bug: bugzilla.redhat.com/show_bug.cgi?id=1306992
    – erik
    Sep 5, 2016 at 16:37
  • 4
    It seems this is the only way to remove packages from /var/cache/PackageKit/24 or /var/cache/PackageKit/25 directories after upgrade to Fedora 26. pkcon from accepted answer does not remove them.
    – ks1322
    Sep 11, 2017 at 15:40
  • 1
    Yes. I found I had cache from Fedora 23 - 27, and hawkey. Running the command in the pkcon seemed to drop the usage from 23 GB to 20 GB. So instead I ended doing a rm -rf and then ran the pkcon command to makes sure package kit had the minimum it needed to work.
    – user6856
    Nov 20, 2017 at 13:49

if not using PackageKit to update (but dnf) one should consider disabling PackageKit auto-download, because PackageKit will only clear its cache when using it to install updates:

gsettings set org.gnome.software download-updates false

I think this auto-download should be opt-in instead of opt-out.



  • I will try this one. Let’s see if it works. I did this with sudo, i.e. as user root.
    – erik
    Jan 22, 2017 at 8:07

The pkcon refresh force -c -1 solution didn't work for me since there was multiple Fedora versions in the wake in my upgrade path. I solved the space issue constructively by dnf clean all --releasever=xxx where xxx is the old version that needed cleaned out. It cleaned out about 8 Gig of space for the previous version.


The pkcon refresh [force] command given in the accepted answer works, but, importantly, only for currently enabled repositories. It doesn't delete no longer needed files in the caches for older repositories, most notably for old distribution versions. Those can be safely deleted manually. (If you really want to delete them using pkcon, then some manner of pkcon repo-enable [reponame]; pkcon fresh force; pkcon repo-disable [reponame] can work.)


I was getting storage space warnings when booting Fedora25 on my virtual machine. I followed the aforementioned solution to edit the /etc/PackageKit/PackageKit.conf file and uncommented the #KeepCache=false line and saved the file. Then I ran the following cmd: pkcon refresh force -c -1 but there were still unwanted files in /var/cache/PackageKit/ so i ran rm -r -f /var/cache/PackageKit/* at the command line to delete these cached files. I restarted Fedora and Voila! No more errors!!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .