I was trying to change default boot option for my laptop(ubuntu and Windows). I can not update the grub which is the last step. When enter the command "sudo update-grub" i get this error "Searching for GRUB installation directory ... found: /boot/grub /etc/default/grub: line 1: ^Y: command not found".

I followed these instructions, How do I set Windows to boot as the default in the boot loader?

I installed boot-repair tool and this is my URL: http://paste.ubuntu.com/11907417/


Your /etc/default/grub has a stray ^Y in it:

=================== /etc/default/grub :

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

Just delete that line and you should be fine. You can use the following command to delete line 1 (since that's where the error is):

sed -i.bak 1d /etc/default/grub
  • Thanks. That solved my current problem, but even though after updating grub I am not able to boot in windows as default OS. The prompt still selects Ubuntu. – algOs Jul 27 '15 at 3:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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