8

I'm trying to update my grub config on ubuntu server 12.04.3 to include the GRUB_RECORDFAIL_TIMEOUT variable as described here: https://help.ubuntu.com/community/Grub2.

The procedure says run update-grub after making the change but it's doesn't appear to be on my system. How can I install this?

11

I would reinstall grub by running the following command:

sudo apt-get update; sudo apt-get install --reinstall grub
| improve this answer | |
  • 1
    i lost update-grub after a do-release-upgrade. This worked for me. – boredcoding May 14 '17 at 20:07
  • 5
    I also did do_release_upgrade but don't know if I lost it after that. if I run the above command, this is what I get: Package grub is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: grub2-common – nurp Sep 25 '18 at 9:32
19

The update-grub command was created to make things easier - it is simply a shell script in /usr/sbin/:

#!/bin/sh
set -e
exec grub-mkconfig -o /boot/grub/grub.cfg "$@"

If it is not there, you can make your own. To do that, run this, and paste in the above script:

sudo nano /usr/sbin/update-grub

Save with Ctrl+O, and exit with Ctrl+X.

Then run these:

sudo chown root:root /usr/sbin/update-grub
sudo chmod 755 /usr/sbin/update-grub

And you should now be able to run update-grub. :-)

| improve this answer | |
  • Thanks, since it was missing I reinstalled grub. Not sure if anything else might of went missing. – Andy Arismendi Feb 9 '14 at 19:42
  • 2
    This is a lifesaver if reinstalling grub is not an option because of a broken system. – plok May 5 '15 at 11:00
  • Yes, really, lifesaver. The update-grub command was on my system, but gave me a /cow error, this one gave no error output. – Quidam May 2 at 8:24
  • Do you know how to regenerate grub.cfg from a live session? – Quidam May 2 at 8:25
  • @Quidam askubuntu.com/q/145241/178596. Also tools such as Boot Repair AFAIK can do it sort of. Recovery Mode if you can access that is also an option (Dropping to a root shell prompt which can run commands after mounting partitons) – Wilf May 2 at 9:37
0

you need to run it with root priviledges, run: sudo update-grub. Unless you removed it, its there in the system.

| improve this answer | |
  • 2
    It was definitely gone, not sure how it went missing. Re-install grub brought it back. – Andy Arismendi Feb 9 '14 at 19:43

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.