How to erase old Linux Kernels (Debian based distros)

Type on terminal:

$ dpkg --get-selections | grep linux-image

A list with all the kernels will appear. Here it is possible to find the names we have to use in the next command. It is possible to erase all the kernels except the last one. Just type:

$ sudo aptitude purge <kernel>

Where <kernel> is the name of the kernel we want to erase (got from the previous command).

NOTE: Do NOT erase the linux-image-generic, it is necessary to update the kernel.

Source