3

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?

2
3
  • 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 pressing CRTL+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.

5
  • 3
    Just edit /etc/default/grub without touching grub.cfg and run: grub-mkconfig -o /boot/grub/grub.cfg Dec 29 '16 at 13:18
  • 2
    In Ubuntu you can update Grub2 just running sudo update-grub Dec 29 '16 at 13:43
  • 1
    Editing /boot/grub/grub.cfg is not recommended. /etc/default/grub is there for a reason. Dec 29 '16 at 14:43
  • I tried this way. But after updating grub2 it's all the same as before. Dec 29 '16 at 14:52
  • So I told last two lines at my answer. Dec 30 '16 at 8:50

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