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

Step 1

Next, take notes of your current kernel. DO NOT REMOVE THIS!

Step 2

Next, type the command below to view / list all installed kernels on your system.

dpkg --list | grep linux-image

Step 3

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.

Step 4

Finally, run the commands below to remove the kernel you selected.

sudo apt-get purge linux-image-x.x.x.x-generic

Step 5

When you’re done, run the commands below to update grub2

sudo update-grub2

Step 6

That’s all.