PDA

View Full Version : [SOLVED] Boot menu for Ubuntu appears twice



102jon
February 19th, 2011, 04:38 AM
I recently installed Ubuntu 10.10 with Wubi, however after an update was performed on Ubuntu, Ubuntu's boot options appear twice upon starting up the computer. I get the following selections:

Ubuntu generic
Ubuntu (recovery mode)
Ubuntu generic
Ubuntu (recovery mode)

How can I fix this?

Sean Moran
February 19th, 2011, 05:08 AM
I recently installed Ubuntu 10.10 with Wubi, however after an update was performed on Ubuntu, Ubuntu's boot options appear twice upon starting up the computer. I get the following selections:

Ubuntu generic
Ubuntu (recovery mode)
Ubuntu generic
Ubuntu (recovery mode)

How can I fix this?
G'day Jon. It's me again. This one's a little easier than the wireless problem.

The reason you're getting two listings for Ubuntu 10.10 since performing the update is that the kernel has updated, so GRUB sees the old and the new kernel in the /boot directory. One of these kernel versions will be:
abi- config- initrd.img- System.map- vmcoreinfo- and vmlinuz- (prefixes)
2.6.35.24-generic (common suffixes)

The other one will either swap the .24- for a higher or lower number, and I assume higher, but don't remember whether I've updated that Meerkat installation or not - I hardly ever use it.

There are probably smoother ways of removing the old kernel version from the GRUB menu, but the way I've always tended to do it has involved installing startupmanager: sudo apt-get install startupmanager

... then I cd /boot and rm-rf *-2?-*
(the lower, older kernel files - BE CAREFUL NOT TO DELETE THE UPDATED KERNEL)
... then I System -> Administration -> Startup-Manager and change the Timeout or something simple, and reboot. The old kernel listing in GRUB is gone.

You could also edit out the old menuentry from the /boot/grub/grub.cfg file, although there is a warning there at the top of the file that says "DO NOT EDIT THIS FILE", so I can't recommend that one.

102jon
February 19th, 2011, 05:23 AM
Hi Sean, thanks again for the help. Here is the output of those commands (it looks like there was an error of some sort):



jonathan@ubuntu:~$ sudo apt-get install startupmanager
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-2.6.35-22-generic linux-headers-2.6.35-22
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
menu
Suggested packages:
menu-l10n
The following NEW packages will be installed:
menu startupmanager
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 571kB of archives.
After this operation, 3,502kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Err http://us.archive.ubuntu.com/ubuntu/ maverick/universe menu amd64 2.1.44ubuntu1
Could not resolve 'us.archive.ubuntu.com'
Err http://us.archive.ubuntu.com/ubuntu/ maverick/universe startupmanager all 1.9.13-5
Could not resolve 'us.archive.ubuntu.com'
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/universe/m/menu/menu_2.1.44ubuntu1_amd64.deb Could not resolve 'us.archive.ubuntu.com'
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/universe/s/startupmanager/startupmanager_1.9.13-5_all.deb Could not resolve 'us.archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
jonathan@ubuntu:~$ cd /boot
jonathan@ubuntu:/boot$ rm-rf *-2?-*
rm-rf: command not found
jonathan@ubuntu:/boot$

Sean Moran
February 19th, 2011, 05:52 AM
A couple of errors, but luckily, the second error saved the confusion that the first error would have caused.

ERROR #1:
Good work with providing the output of the sudo apt-get install startupmanager command. What this part tells me ...


Err http://us.archive.ubuntu.com/ubuntu/ maverick/universe startupmanager all 1.9.13-5
Could not resolve 'us.archive.ubuntu.com'


... is that you weren't able to access the http://us.archive.ubuntu.com universe repository to download the startupmanager.deb file. I'm assuming that YOUR current connection is operational because you're here on the forum. Only suggestion I can think of is to System -> Administration -> Software Sources, where you can change the setting in the Ubuntu Software tab for Download from: to Main Server.

Make sure that the checkboxes for Main, Universe, Restricted, and Multiverse are all ticked, and when you close Software Sources, click Reload to update the software sources. Chances are you've already selected the Universe and Multiverse repositories, but this will make sure that if the connection to the US server was not too good, you can try another server.

This is getting complicated but please bear with me.

ERROR #2:
The second error was my poor communication skills, but the 1st error indicates that -24- is the updated kernel, because -22- is the old kernel that apt-get is suggesting you sudo apt-get autoremove. That's the kernel that is causing the extra entry in the GRUB menu.

When I wrote *-2?-* I meant the oldest (ie. lowest number) by the ?, but that was lucky. The actual command to remove the old kernel files from your /boot directory is therefore:



cd /boot
sudo rm -rf *-22-*


Sorry I didn't provide a clear explanation of what that *-2?-* with the question mark meant.

It can't hurt to just remove the redundant *-22-* kernel files, even without Startup Manager, but GRUB will still remain unchanged evedn if those files are gone. I believe that the command:



sudo update-grub

will achieve what Startup Manager does in the GUI anyway, so from the beginning, without Startup Manager,


sudo apt-get autoremove
cd /boot
sudo rm -rf *-22-*
sudo update-grub
sudo reboot

That should sort things out without needing to access the http://us.archive.ubuntu.com repository.

Sorry for this long-winded advice that could have been explained in five lines if I was currently logged into my Meerkat installation, instead of here on Karmic.

wilee-nilee
February 19th, 2011, 05:56 AM
Don't use the rm-rf command thankfully you didn't under stand it as it is a cold wiping command if used wrong it can wipe the hd or other lower areas.

Personally since wubi is not a long term designed setup but for trying out, before a full install I would just leave the grub menu alone. The menu is sort of a dummy just to get in, it is not reading the mbr as it normally would.

CharlesA
February 19th, 2011, 06:04 AM
Don't use the rm-rf command thankfully you didn't under stand it as it is a cold wiping command if used wrong it can wipe the hd or other lower areas.

Personally since wubi is not a long term designed setup but for trying out, before a full install I would just leave the grub menu alone. The menu is sort of a dummy just to get in, it is not reading the mbr as it normally would.
+1.

rm -i is a better way to do it.

EDIT: The easier/better way to remove old kernels is in synaptic or using apt-get/aptitude.

102jon
February 19th, 2011, 10:42 PM
Great, that worked perfectly! Thanks so much for all the help Sean, much appreciated. :)

frankduffey
February 22nd, 2011, 11:42 AM
this command did not work in Ubuntu 10.10 I tried the terminal; is this a root cmd?

CharlesA
February 24th, 2011, 11:18 PM
It needs to be run by root, but an easier way to remove old kernels is to use Synaptic.