I am using Ubuntu 14.04 alongside Windows 10. Other family members of my family also use my pc. And they are not comfortable with Ubuntu as they are used to with Windows. Sometimes they face difficulties while selecting boot option from grub. Now my question is, can I edit grub2 and change the default boot option? If it is possible, how to do it?
Asked
Active
Viewed 3.5k times
4
-
7Hope this askUbuntu answer will be helpful – dkb Dec 29 '16 at 12:00
-
http://askubuntu.com/a/110738/304559 . also read the comment by geekQ there – Gayan Weerakutti Dec 29 '16 at 14:48
1 Answers
6
- Open a terminal window and execute:
sudo nano /boot/grub/grub.cfg
- Enter your password.
- In the file opened, find the text:
set default="0"
- Number 0 is for the first option, number 1 for the second one, etc. Change the number for your choice.
- Save the file by pressing
CTRL+O
and exit by pressingCRTL+X
.
This will change in every grub update. So, if you want to have it made permanently edit the file /etc/default/grub
and set GRUB_DEFAULT=0
to the number of your choice.
-
5Just edit
/etc/default/grub
without touching grub.cfg and run:grub-mkconfig -o /boot/grub/grub.cfg
– Andrius Štikonas Dec 29 '16 at 13:18 -
4In Ubuntu you can update Grub2 just running
sudo update-grub
– Sergi Quiles Pérez Dec 29 '16 at 13:43 -
2Editing
/boot/grub/grub.cfg
is not recommended./etc/default/grub
is there for a reason. – Gayan Weerakutti Dec 29 '16 at 14:43 -
I tried this way. But after updating grub2 it's all the same as before. – Mostafiz Ur Rahman Dec 29 '16 at 14:52
-
1