Adsense 1

Thursday, December 20, 2012

Completely remove Kernel and related packages in Ubuntu

I had many versions of kernel installed in my system and ran out of space in /boot. So i decided to remove old versions that i don't use anymore.

First in terminal type:
$  dpkg -l|grep Eg: dpkg -l|grep 3.5.0-16

It will typically show 4 packages:
1. linux-headers-
2. linux-headers--generic
3. linux-image--generic
4. linux-image-extra--generic

You can remove all the above 4 packages with
$sudo apt-get remove linux-headers- linux-headers--generic linux-image--generic linux-image-extra--generic

This will remove the packages, free up space and also adjust your grub automatically. Note that i am using Ubuntu 12.10 but i think this will work for old versions too.