Tuesday, June 28, 2016

Removing old kernels on Ubuntu.

On Linux distributions you get kernel update and the images of old kernels remain on your machine occupying space. I got a kernel update today:
$ uname -r
4.4.0-28-generic
After restart I could see that the image of old kernel was present on the machine:
$ dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r)
ii  linux-image-4.4.0-24-generic                4.4.0-24.43                                         amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
I removed the old kernel by using following commands one by one:

sudo dpkg --purge linux-signed-image-4.4.0-24-generic
sudo dpkg --purge linux-image-extra-4.4.0-24-generic
sudo dpkg --purge linux-image-4.4.0-24-generic
I removed the kernel headers by using following commands one by one:
sudo dpkg --purge linux-headers-4.4.0-24-generic
sudo dpkg --purge linux-headers-4.4.0-24
Since I remove the previous image on every kernel update I had to remove only 4.4.0-24 but if you are doing it first time you may have many images starting from 4.4.0.21


We are registered voters of Bhopal as per Final eRoll published on 21 Feb 2026.

 We relocated to Bhopal from Delhi wef 28 June 2025. I immediately applied for change of address on Aadhar and got it on 06 July 2025. Then ...