I recently ran out of space creating a backup of the important directories of my 20 GB worth of Ubuntu 16.04 onto the same 30 GB partition my Ubuntu 16.04 is stored on. Part of the problem was an older backup that crashed and a 6 GB .tar
file was still in /
and needed to be deleted (tar: file changed as we read it). The other part of the problem is I had 21 kernels installed taking up way too much space.
I've already written a humble bash script called rm-kernels to remove older kernel versions but it doesn't display the size a kernel takes ups accurately. For example in the link you can see it erroneously displays ~50 MB but in reality a kernel takes up ~300 MB:
My humble bash script merely lists the size of a given Kernel's files in /boot
directory. I wish to add the size of files in /usr/src/kernel_version
and /lib/modules/kernel_version
which I've stumbled across.
As I've stumbled across these directories by chance I wonder: Are there other directories I need to add?