Remove the old kernel from Ubuntu November 25, 2007
Posted by sandakith in linux, Open Source.trackback
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 :
Code:
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.
” sudo apt-get remove –purge 2.6.24-17* ” try it this way Now It will work.
” 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
thanx … found it useful
🙂
The correct command format is:
$ sudo apt-get remove –purge 2.6.24-17*
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.
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.
sudo apt-get remove –purge 2.6.27-9-*
This is the correct command
sudo apt-get remove –purge 2.6.27-9-*
sudo apt-get remove –purge 2.6.24-17-[7,9]*
Agree on newer versions of Ubuntu
Glad to see my post helped ..
Lahiru
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 2.6.28.14 kernel
Also you may go to the synaptic manager and search the “linux-image.2” string and unmark all the kernels you dislike
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.
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:
linux-image-2.6.28-16-generic
I also want to remove:
linux-headers-2.6.28-16
linux-headers-2.6.28-16-generic
linux-restricted-modules-2.6.28-16-generic
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