Possible Duplicate:
Is there a way to remove/hide old kernel versions?

Any clean solutions for cleaning up the /boot mount? It seems to fill with kernels but I'd like to make sure the overall package management knows they are gone.

Do you really need to remove one by one?



What I can guess is that you might to remove the old kernels. You can do this by

  1. uname -r

uname -r

Note down the current version of kernel

dpkg -l 'linux-image-*' | grep '^ii'

output of dpkg -l linux-image-...

Note down the kernel version(s) (the numbers after the linux-image, ie x.y.z.-generic) (Include "-generic too")

Then run this command to delete old kernels WARNING : DO NOT DELETE THE KERNEL WHOSE VERSION YOU PREVIOUSLY NOTED DOWN IN "uname -r"

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

(In my case it will be sudo apt-get purge linux-image- since linux-image- is the version I noted down in "uname -r")

Lastly update grub with the commands

sudo update-grub2


sudo update-grub

(Running both wont do any harm to the computer)

Hope this helped you.

  • Thanks...thats a bit what I was concerned about. The one by one approach
    – Cykoduck
    Feb 13 '12 at 16:01
  • 1
    dpkg -l 'linux-image-[0-9]*' | grep '^ii' | grep -v `uname -r` | awk '{print $2}' | xargs sudo apt-get purge -y # close eyes and press Enter Feb 19 '13 at 20:36

If you don't like uninstalling them one by one, install synaptic, start it, search for "linux" there - it'll show you the list of your kernels.

tick-tick-tick; Uninstall; Apply. Done.

Not the answer you're looking for? Browse other questions tagged or ask your own question.