I have installed a couple of custom compiled kernels on Ubuntu and want to remove them. I will breifly describe how to remove the kernels
1. Open up a terminal (Ctrl+Alt+T). Type:
$ uname -r
This will show you the kernel you’re using currently, so you don’t want to remove this.
2. Run the following command:
$ dpkg --list | grep linux-image
This will show the all the kernels that are installed. Be careful write down the names of all the kernels which you want to remove.
3. To remove the kernels use the command:
$ sudo apt-get purge linux-image-x.x.x.x-xyz
In my case to remove the kernel linux-image-3.5.0-17-generic (as shown in the picture above) I will use the command
$ sudo apt-get purge linux-image-3.5.0-17-generic
4. The update has to be reflected at Grub so run the command:
$ sudo update-grub2