On an old server that still runs Ubuntu 16.04 the /boot partition is full, not with old kernels but with kernels that are all newer than the one that is running.
I'm running 4.4.0-176-generic, and the listing is like this (same with initrd.img* files):
-rw------- 1 root root 7220256 Dec 1 19:58 vmlinuz-4.4.0-198-generic
-rw------- 1 root root 7217792 Nov 27 14:03 vmlinuz-4.4.0-197-generic
-rw------- 1 root root 7220608 Nov 10 19:34 vmlinuz-4.4.0-194-generic
-rw------- 1 root root 7221056 Oct 14 2020 vmlinuz-4.4.0-193-generic
-rw------- 1 root root 7220448 Aug 31 2020 vmlinuz-4.4.0-190-generic
-rw------- 1 root root 7217792 Aug 14 2020 vmlinuz-4.4.0-189-generic
-rw------- 1 root root 7219360 Jul 22 2020 vmlinuz-4.4.0-187-generic
-rw------- 1 root root 7209656 Mar 16 2020 vmlinuz-4.4.0-177-generic
-rw------- 1 root root 7209560 Feb 28 2020 vmlinuz-4.4.0-176-generic
How can I safely clean things up?
I currently cannot install anything with apt-get, I get errors such as:
root@dev-server1:/boot# apt-get install postfix
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-image-generic : Depends: linux-image-4.4.0-200-generic but it is not going to be installed or
linux-image-unsigned-4.4.0-200-generic but it is not going to be installed
Recommends: thermald but it is not going to be installed
linux-modules-extra-4.4.0-200-generic : Depends: linux-image-4.4.0-200-generic but it is not going to be installed or
linux-image-unsigned-4.4.0-200-generic but it is not going to be installed
postfix : Depends: ssl-cert but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
...which looks strange as it is referring to a kernel that is not even there.
Thanks,
George