Remove Old Kernels in Ubuntu
To get started, open Terminal. When it opens, run the commands below to view your current running kernel.
uname -r
Next, take notes of your current kernel. DO NOT REMOVE THIS!
Next, type the command below to view / list all installed kernels on your system.
dpkg --list | grep linux-image
Next, find all the kernels that which number are lower than your current kernel. When you know which kernel to remove, continue below to remove it.
Finally, run the commands below to remove the kernel you selected.
sudo apt-get purge linux-image-x.x.x.x-generic
When you’re done, run the commands below to update grub2
sudo update-grub2
That’s all.