jump to navigation

Remove the old kernel from Ubuntu November 25, 2007

Posted by sandakith in linux, Open Source.

Ubuntu always keeps the old kernel when it install a new one, just in case this new one doesn’t work well for you.

You can uninstall the old one if you don’t use it anymore :


X@X-laptop:~$ sudo apt-get remove - -purge 2.6.24-17-*

Doing this will uninstall the packages related to the 2.6.15-23 kernel, like “linux-image-2.6.15-23-386”, “linux-restricted-modules-2.6.15-23-386”, etc. But if you have software like VMWare that has some heavy coupling with that particular version of the kernel you should not do this.



1. gman - August 18, 2008

” sudo apt-get remove –purge 2.6.24-17* ” try it this way Now It will work.

2. gman - August 18, 2008

” sudo apt-get remove –purge 2.6.24-17* ”

1) there is two – – between remove and purge with no spaces
2) and no – at the end of the 7 .

Thanks sandakith

3. digitalpbk - November 8, 2008

thanx … found it useful

4. Coco Palm Sugar - December 18, 2008

The correct command format is:
$ sudo apt-get remove –purge 2.6.24-17*

5. Coco Palm Sugar - December 18, 2008

Hmm… the comment system is filtering the double “-” before the purge option.

And for probably the same reason, the poster had to put in a space between “-” which makes it all wrong.

Hope this helps.

6. SEMP - February 16, 2009

Hello everybody,

I think there is a little mistake in your post. If you set the command

sudo apt-get remove –purge 2.6.24-17-*

you’ll get apt-get to remove ALL the kernel images, even the one in use. I suggest the right form is

sudo apt-get remove –purge 2.6.24-17-[7,9]*

where the numbers between brackets correspond to those kernels you want to remove.

7. digitalpbk - April 14, 2009

sudo apt-get remove –purge 2.6.27-9-*

This is the correct command

8. janvill - July 12, 2009

sudo apt-get remove –purge 2.6.27-9-*

9. sandakith - July 31, 2009

sudo apt-get remove –purge 2.6.24-17-[7,9]*

Agree on newer versions of Ubuntu

Glad to see my post helped ..

10. Janneman - August 28, 2009

This is the EXACT code to enter. I just unistalled three old kernels using this EXACT code:

sudo apt-get remove –purge 2.6.28-14-*

This code deleted the Ubuntu 9.04 kernel

11. Andrey - September 10, 2009

Also you may go to the synaptic manager and search the “linux-image.2” string and unmark all the kernels you dislike

12. ecosseman - September 30, 2009

Removing all the kernels in a version – does this effectively uninstal the version or can this have adverse effects? I have 3 different Ubuntu versions and wish to uninstal one. Regards.

13. BroE - February 25, 2010

I personally used:
sudo apt-get remove –purge 2\.6\.28-16.*

(As other people have remarked, note the two – marks before purge)

I also looked for the linux-image.2 string in Synaptic but it did not list all the sub-parts of the kernel.

In addition to:


I also want to remove:


The command line did this, but it wasn’t clear that Synaptic would.

Also, note that you can find out what kernels, etc are on your system by typing:

dpkg -l | grep linux-head

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: