Taming PackageKit's disk usage

PackageKit is is a D-Bus abstraction layer that allows the session user to manage packages in a secure way using a cross-distro, cross-architecture API.

To me is more a space hog that caches all available RPM updates of my installed software, with no reasonable way of getting them cleaned/expunged.

There are a few bugs still opened for F24 and F25 on its default behaviour and while no consensus has been reached, I was still in need of a way to trim the usage of my /var/cache/PackageKit directory.

The long term solution is apparently to just disable the software updates via Gnome's gconf :

$ gsettings get org.gnome.software download-updates
true

$ gsettings set org.gnome.software download-updates false

$  gsettings get org.gnome.software download-updates
false

This will only affect future downloads; it does not take care of actually cleaning the currently cached packages. The pkcon tool should take care of this:

# pkcon refresh force -c -1
Refreshing cache              [=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Finished                      [=========================]         

... however it seems it only cleans old information partially. In the end I ended up going through the drastic method and just sudo rm -rf /var/cache/PackageKit/* .

Happy hacking!