While booting the system shows two impressions (ubuntu.2.6.38-11-generic and ubuntu 2.6.38-11-generic) are shown in the boot menu. How can I merge them or get rid of the older version?

link|improve this question
I think this question has been asked many times. Some one should have a look. – karthick87 Aug 28 '11 at 5:49
I don't use GRUB menu at present, but I think there must be Grub folder in the GUI of system settings - where you can customize all about the grub-menu. – Adobe Aug 28 '11 at 5:50
possible duplicate of Is there a way to remove/hide old kernel versions? – fossfreedom Aug 28 '11 at 9:51
feedback

2 Answers

These are old kernels that your system keeps around in case you have a problem with your current kernel. In general, it's a good idea to keep at least one previous kernel around to boot into if necessary.

The easiest way to get rid of older kernels is to open Synaptic Package Manager and search for packages beginning with linux-image which also contain a version number.

I believe there's also a program called Computer Janitor that will clean up old kernels for you, so you could try that as well.

You can also install the Grub Customizer package to choose what menu entries you have at boot. This way you can keep some old kernels, but just not seem them in the menu.

See here for more details.

link|improve this answer
feedback

here is a rough outline of what I did, careful as I am no expert in linux, be sure you know what you are doing and have backed up any files you are modifying.

gedit /boot/grub/grub.cfg

then find the entries you want to keep, we will highlight and copy them

cd /etc/grub.d
ls

you'll see a list of files like 10_linux and 30_os-prober

sudo chmod -x 10_linux

this will stop form auto adding all the linux entries into the grub boot menu.

gksudo gedit 40_custom

open the custom boot menu file, then go back to grub.cfg (which should still be open in gedit), and copy the entries you want to keep... such as

menuentry "My Default Karmic" {
  set root=(hd0,1)
  search --no-floppy --fs-uuid --set cb201140-52f8-4449-9a95-749b27b58ce8
  linux /boot/vmlinuz-2.6.31-11-generic root=UUID=cb201140-52f8-4449-9a95-749b27b58ce8 ro quiet splash
  initrd /boot/initrd.img-2.6.31-11-generic
}

paste them into 40_custom, and then save it.

sudo chmod 755 40_custom

makes it executable, then finally we update grub which will change the grub.cfg file:

sudo update-grub

Now, BEWARE, if you update your kernel or OS, your boot menu probably will not update... you'll have to do that manually. But doing this procedure will let you customize the boot menu a bit more, such as remove the kernel version and just put the ubuntu name... i.e. Ubuntu Lucid 10.04, etc...

Hope someone finds this helpful, as it took me a while to figure out... didn't see this solution anywhere...

link|improve this answer
1  
This answer seems like overkill. It's better to just remove old kernels. – Scott Severance Jan 8 at 23:32
I had read that extra kernels may be useful in the event of recovery situations. Also, this is a simple way to edit the text of the boot entry. So rather than saying "Ubuntu, Linux kernel x.x.xx-yy --text1 -text2 -t3 -t4 --t5 etc etc etc" (where the --text entries just denote some options/parameters I don't understand) you can change it to "Ubuntu xx.yy" although I had a "{" bracket I couldn't get rid of. – Joe Jan 9 at 22:35
I keep the immediate previous kernel around until I've verified the the most current kernel works properly. If it works, it isn't going to stop working. So, after I've verified the most recent kernel (after a week or so), I have no reason to keep the old kernel around. If it doesn't work, then I have the latest known-good kernel to fall back to. Actually, I'm currently running an old kernel due to a showstopper bug in the current kernels. But that doesn't change my overall policy. You only need one known good kernel. – Scott Severance Jan 10 at 5:14
feedback

Your Answer

 
or
required, but never shown

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