Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to change the default OS in grub, but when I do

sudo gedit /boot/grub/grub.cfg and change it to option 3 instead of 0 and run update-grub, nothing changes. The default selected OS is still the first one and when I look in grub.cfg it's back to 0. What am I doing wrong?

share|improve this question
up vote 8 down vote accepted

As stated on the top of /boot/grub/grub.cfg:

# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub

Edit /etc/default/grub instead.

Here are details on how to configure the grub file; see the other answers there for a GUI-based method.

share|improve this answer

For a small change, just save grub.cfg without update-grub afterwards.

Just realize that anything you do will revert to the information in the scripts the next time update-grub is called.

Thus the reason we don't edit grub.cfg directly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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