How to remove/delete old or unused kernels in Ubuntu

  If you have upgraded your kernel you will have found that Ubuntu keeps the older ones around, which can be handy if something breaks in the newer kernel and you have to boot from your old system. Over time, however, these can add up in terms of the amount of space consumed – at around 150MB per kernel you could easily find yourself with over a GB of old kernels if you’ve upgraded enough times. In this example the system we are using is Ubuntu If you’re using Ubuntu Desktop, open up a terminal window – if you’re using Ubuntu Server, log in as usual and run:  
uname -r
to see which kernel you are currently running. Make sure not to delete this one. Now, to see a list of the installed kernels, we run:  
dpkg –list | grep linux-image
This command lists the installed packages and filters the list to include only those which have “linux-image” in them, which should only be your kernels. Your list should look something along the lines of:  
ii  linux-image-2.6.32-33-server 2.6.32-33.72     Linux kernel image for version 2.6.32 on x86_64 ii  linux-image-3.2.0-35-generic 3.2.0-35.55      Linux kernel image for version 3.2.0 on 64 bit x86 SMP ii  linux-image-3.2.0-38-generic 3.2.0-38.61      Linux kernel image for version 3.2.0 on 64 bit x86 SMP ii  linux-image-server       Linux kernel image on Server Equipment.
  To remove a kernel, run the following:  
sudo apt-get purge [kernel]
  Using the above list, say we want to get rid of 3.2.0-35. In that case the command would be:  
sudo apt-get purge linux-image-3.2.0-35-generic  
Once you have removed your unwanted kernels run:  
sudo update-grub2
  This will update the boot menu accordingly.

How to find kernel version in Ubuntu 12.04 Precise Pangolin

Note: This also works in other versions of Ubuntu, such as 11.10, 11.04, 10.10, 10.04 and earlier.   Sometimes you may wish to find out which kernel you’re  currently running; fortunately, this is quite easy to do with the uname command. If you’re running Ubuntu Desktop, open up a Terminal; if you’re using Ubuntu Server log in as per usual and then run:  

uname -v

…for the kernel version, or:  

uname -r

for the kernel release. You can combine the two and use:  

uname -rv

to see both of those with the one command.