blog.zapster.cc

random notes...

Keeping Fedora Clean

Auxiliary files can account for a lot of space in a long running Linux installation.

Cleaning journalctl logs

StackExchange answer proposing journalctl --disk-usage. StackExchange answer on cleaning journalctl logs.

Retain only the past two days:

journalctl --vacuum-time=2d

Retain only the past 500 MB:

journalctl --vacuum-size=500M

Cleaning PackageKit cache

StackExchange answer on cleaning PackageKit cache.

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.

and

   -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)

Pruning docker images

This StackOverflow answer suggests the following command to remove all unused docker images.

1
docker rmi $(docker images -f "dangling=true" -q)

They also mention that with docker 1.13 new maintenance commands like docker system prune are available.

References:

  • journalctl: StackExchange answer on cleaning journalctl logs
  • journalctl-disk-usage: StackExchange answer proposing journalctl --disk-usage
  • PackageKit: StackExchange answer on cleaning PackageKit cache
  • docker-clean: StackOverflow answer on cleaning unused docker data

Comments