Getting rid of old initrd files on Ubuntu
Occasionally I see some of our Ubuntu machines having /boot partition filled up by the initrd files generated from old kernels which no longer were no longer installed on the machines. root@matht232:/boot# uname -a Linux matht232 5.3.0-40-generic #32~18.04.1-Ubuntu SMP Mon Feb 3 14:05:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux root@matht232:/boot# dpkg -l linux-image-\* | grep ^ii ii linux-image-5.3.0-40-generic 5.3.0-40.32~18.04.1 amd64 Signed kernel image generic ii linux-image-generic-hwe-18.04-edge 5.3.0.46.102 amd64 Generic Linux kernel image root@matht232:/boot# ls -1 /boot config-5.3.0-40-generic config-5.3.0-46-generic grub initrd.img-3.13.0-46-generic initrd.img-4.15.0-88-generic initrd.img-4.4.0-101-generic initrd.img-4.4.0-122-generic initrd.img-4.4.0-87-generic initrd.img-5.3.0-40-generic lost+found System.map-5.3.0-40-generic System.map-5.3.0-46-generic vmlinuz-5.3.0-40-generic vmlinuz-5.3.0-46-generic I tried to remove these initrd files manually, and they were generated again when a new kernel is installed. I haven’t figured how did this happened, until today! ...