Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Ubuntu 10.10 and after few updates the boot menu lists many kernel versions. How do I remove older versions?

share|improve this question
up vote 7 down vote accepted
  1. Check for currently-installed kernels:

    $ dpkg --get-selections | grep linux-image
    linux-image-2.6.38-2-686-bigmem         install
    linux-image-2.6.32-5-686                install
  2. Check what current kernel you are running:

    $ uname --all
    Linux debian 2.6.38-2-686-bigmem #1 SMP Thu Apr 7 06:05:53 UTC 2011 i686 GNU/Linux
  3. Remove the kernel(s) you are displeased with, generally keeping the latest (and greatest).

    $ sudo apt-get remove linux-image-2.6.32-5-686

I think it's a good idea to keep at least two different versions though. However, I think this advice used to be more useful some time ago, because it seems the kernel gets more and more stable (I experience far less trouble than I used to), but maybe I'm lucky.

share|improve this answer

I just wanted say that don't remove the other installed kernels, you may need one of them one day. It actually happened to me, I had to update my ubuntu, and it installed a new kernel version after that. reboot choosing the new kernel, it crashs! (I guess the my VGA driver wasn't compatible with the new kernel version or something like that). Any way I rebooted choosing the old kernel, and it start working fine.

My point is leave at least one that is working besides the newly installed one, you may gonna need it one day.

share|improve this answer

I'm adding a little to Tshepang:s answer.

Since you can use uname -r and grep -v to remove the current kernel from the list.

dpkg --get-selections | grep linux-image | grep -v `uname -r`
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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