LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices



Reply
 
Search this Thread
Old 07-20-2007, 05:17 AM   #1
ussr_1991
LQ Newbie
 
Registered: Jan 2007
Location: Singapore
Distribution: Windows XP,Mac OS X 10.4
Posts: 24

Rep: Reputation: 15
How to remove the previous Ubuntu linux kernel.


Recently, when I go for an update. There is update of kernel. However, since then , I have 2 more options, which are the 2 new version of Kernel and its recovery mode.
I do not know what to do with the Grub as I tried to "c" (Without the " ") and d or e.(Command-Line tried before, Delete a command , edit the command also)
Note: After i finish, I press Esc and there is nothing change. How should I save them. There is no "s" .(Without the " ")
Perhaps, there might be a better way to do. If there is , can anyone kindly say so.
Thanks.
 
Old 07-20-2007, 05:29 AM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
You can remove them with the packet manager.
Synaptic will show you the kernels you have installed.

However - you should always retain one old kernel that you know works. It will have a regular boot and a recovery option... so will the new kernel, for a total of four menu items.
 
Old 07-20-2007, 07:20 AM   #3
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Even if Synaptic didn't show you the previous kernels (it had simply not removed them, but upgraded your kernel to a new version, thinking there is only one version left) you can simply remove the unneeded kernel files (note the version, don't remove your running kernel ) from under /boot/, and remove the corresponding sections from /boot/grub/menu.lst (or rather just run 'grub-update' as root - it does it automatically for you).

Note that if you have several kernels of same version, with different configurations, the modules might not work for more than one kernel. I usually keep two kernels, current and one older, so that if the current happened to not work, I could use the older one instead. And when you upgrade your kernel it's nice to know there's "backup" available for maintenance, if something goes wrong.

Personally I don't upgrade the kernel unless it's really needed. It just forces to reinstall video/wireless drivers in some cases, and causes headache, and gives nothing new if it works perfectly already before the upgrade. Only if you have devices that need newer kernel, or you want to change the configuration or something, you should upgrade the kernel.

Don't fix a working thing, unless it improves security.
 
Old 07-20-2007, 08:44 AM   #4
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Quote:
Personally I don't upgrade the kernel unless it's really needed.
Normally good advise... a bit harder to follow for users of closely maintained distros like Ubuntu.

When manually removing a kernel - remember to remove the source and headers as well (if installed) And you need to clean up the packet database.

It is cleanest to use the packet manager wherever possible in ubuntu.
 
Old 07-20-2007, 08:47 AM   #5
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Quote:
Originally Posted by Simon Bridge
Normally good advise... a bit harder to follow for users of closely maintained distros like Ubuntu.
Not at all, just add the kernel package to the list of packages that shouldn't be upgraded, in Synaptic or Adept or whatever one uses as the front-end.

Quote:
Originally Posted by Simon Bridge
It is cleanest to use the packet manager wherever possible in ubuntu.
So true. When you don't have a package manager in your distribution, you cry to get one, and when you have one, you cry to get it out Meaning that when there is no package manager, things get difficult when installing big/difficult software packages, and when there is a package manager, you're more or less forced to use it to keep things clean.
 
Old 07-20-2007, 09:24 AM   #6
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Desktop- Debian Lenny, Laptops- Ubuntu 8.10, Debian Lenny UMPC- Ubuntu 8.10
Posts: 1,297

Rep: Reputation: 55
Quote:
Originally Posted by ussr_1991
Recently, when I go for an update. There is update of kernel. However, since then , I have 2 more options, which are the 2 new version of Kernel and its recovery mode.
I do not know what to do with the Grub as I tried to "c" (Without the " ") and d or e.(Command-Line tried before, Delete a command , edit the command also)
Note: After i finish, I press Esc and there is nothing change. How should I save them. There is no "s" .(Without the " ")
Perhaps, there might be a better way to do. If there is , can anyone kindly say so.
Thanks.
Do you just really want to remove the old Kernel(I generally keep them around and don't bother removing them), or do you just want to remove it from your grub list? Since I generally don't uninstall them, I just comment them out of my menu.lst with the # sign. This leaves a working kernel I can get to if something goes haywire, etc.

Just run sudo gedit /boot/grub/menu.lst from terminal, and use the # sign to comment out the old kernel...

Similar to below.. (Note the # sign before Title on the old Kernel and old recovery entry)

Code:
## ## End Default Options ##

title		Ubuntu, kernel 2.6.20-16-generic
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.20-16-generic root=UUID=0d308763-ec3e-4ab7-91c7-17b7b7246d4b ro quiet splash
initrd		/boot/initrd.img-2.6.20-16-generic
quiet
savedefault

title		Ubuntu, kernel 2.6.20-16-generic (recovery mode)
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.20-16-generic root=UUID=0d308763-ec3e-4ab7-91c7-17b7b7246d4b ro single
initrd		/boot/initrd.img-2.6.20-16-generic

#title		Ubuntu, kernel 2.6.20-15-generic
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.20-15-generic root=UUID=0d308763-ec3e-4ab7-91c7-17b7b7246d4b ro quiet splash
initrd		/boot/initrd.img-2.6.20-15-generic
quiet
savedefault

#title		Ubuntu, kernel 2.6.20-15-generic (recovery mode)
root		(hd0,0)
kernel		/boot/vmlinuz-2.6.20-15-generic root=UUID=0d308763-ec3e-4ab7-91c7-17b7b7246d4b ro single
initrd		/boot/initrd.img-2.6.20-15-generic

title		Ubuntu, memtest86+
root		(hd0,0)
kernel		/boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

Last edited by IndyGunFreak; 07-20-2007 at 09:28 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to remove old versions of Ubuntu kernel joe3eagles Ubuntu 20 01-20-2013 02:57 AM
Restore previous kernel muldereric Linux - Newbie 4 07-30-2005 06:22 PM
How to remove my previous Kernal after Kernel Update? seow_ming Linux - General 6 07-12-2005 11:29 AM
How do I uninstall a previous kernel? tlawlessrr Linux - Newbie 1 07-10-2004 11:33 PM
How to remove/reinstall OR revert X to a previous version? C38368 Linux - Newbie 1 05-26-2004 03:57 AM


All times are GMT -5. The time now is 04:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration