Here is an earlier discussion on this:
There are various ways to accomplish this. I chose to set MaxRetentionSec=2months
, but that is purely subjective.
I’m not sure about /boot/efi
or the large bump there, but the large files are usually the various boot loader related files:
$ ll /boot/
total 141M
drwxr-xr-x 3 root root 4.0K Jul 22 06:08 ./
drwxr-xr-x 23 root root 4.0K Jul 21 06:09 ../
-rw-r--r-- 1 root root 213K Jun 18 09:49 config-4.15.0-147-generic
-rw-r--r-- 1 root root 213K Jul 9 13:19 config-4.15.0-151-generic
drwxr-xr-x 5 root root 4.0K Jul 22 06:08 grub/
-rw-r--r-- 1 root root 58M Jul 21 06:08 initrd.img-4.15.0-147-generic
-rw-r--r-- 1 root root 58M Jul 22 04:42 initrd.img-4.15.0-151-generic
-rw------- 1 root root 3.9M Jun 18 09:49 System.map-4.15.0-147-generic
-rw------- 1 root root 3.9M Jul 9 13:19 System.map-4.15.0-151-generic
-rw------- 1 root root 8.1M Jun 18 11:42 vmlinuz-4.15.0-147-generic
-rw------- 1 root root 8.1M Jul 9 13:23 vmlinuz-4.15.0-151-generic
You can always check man hier
page to see what various directories are intended to be used for.
These should be maintained by, I think, unattended-upgrades
. You can run sudo apt autoremove
and before deleting anything it will ask to confirm, and you can check what it might want to remove.
You can also run sudo apt autoclean
to remove some old cruft and I’ve never experienced a problem from running this command, though it does not ask for permission before deleting stuffs.