I have installed ubuntu 15.04 and 14.04. First i had installed 14.04 after that i installed 15.04 and the grub boot menu changed to 15.04. Now i want to revert it, that means i want to change the grub that appears on startup to grub of 14.04. How to do it?
1 Answers
If you look in /etc/default/grub
, you have a variable GRUB_DEFAULT
:
↳ grep GRUB_DEFAULT /etc/default/grub
GRUB_DEFAULT=0
This is the menu entry that will be used by default. To see which menu entries you have, have a look in /boot/grub/grub.cfg
(nl -v 0
is used to add the line numbers):
↳ egrep "^menuentry |^submenu " /boot/grub/grub.cfg | nl -v 0
0 menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-bf88b0d6-7f16-4314-87f5-ce3e84a6a396' {
1 submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-bf88b0d6-7f16-4314-87f5-ce3e84a6a396' {
2 menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
Having GRUB_DEFAULT=0
means booting the first menuentry
. So if you wanted to boot to System setup
by default (as a silly example), set GRUB_DEFAULT=2
and run sudo update-grub
.
In the case you want to boot something in the submenu
by default, you'd have to use the submenu
index, >
and the index of the menuentry
in the submenu. E.g, 4th entry in submenu
, then GRUB_DEFAULT
should be set to "1>3"
It is also possible to set GRUB_DEFAULT
to name label of a menuentry
(first parameter), so GRUB_DEFAULT='System setup'
would also be a valid setting.
Whenever changing /etc/default/grub
, do not forget to run sudo update-grub
.
More reading at https://help.ubuntu.com/community/Grub2/Submenus.

- 1,211
- 8
- 13
-
I dont want to change the order of grub menu. I want to change the grub that appears on startup to grub of 14.04. Currently grub of 15.04 is installed. – Ashish Pal Feb 02 '17 at 07:51
-
I interpret that as you want to change the default boot option from 15.04 to 14.04? Then the easiest way would be to change
GRUB_DEFAULT
. – mgor Feb 02 '17 at 07:55 -
No. I dont want to do that. I dont want the ubuntu 15.04 anymore and want to delete it. But if I delete it I will get grub rescue error. So I thought to change the grub to 14.04 first. – Ashish Pal Feb 02 '17 at 07:58
-
http://askubuntu.com/questions/79813/how-to-remove-a-second-ubuntu-install – mgor Feb 02 '17 at 08:03
-
I did what was said in above link and ran into the problem of grub rescue :( – Ashish Pal Feb 02 '17 at 09:18
sudo grub-install sdX
Replace theX
with your drive-letter, if you have only one drive it will be likelysudo grub-install sda
. – mook765 Feb 04 '17 at 04:42