Grub has an update again, should I run sudo grub-install --no-nvram

Should I run it or not, I mean, will I run into the issue?

In theory, you should run grub-install every time grub updates followed by grub-mkconfig.

That being said, not doing it won’t cause a failure every time.

grub-mkconfig -o /boot/grub/grub.cfg?

2 Likes

Yes, with sudo

Or, if you never remember the complete syntax, you may want to install the update-grub package :wink:

I really don’t understand why anyone would ever do this. It is a trivial script that calls grub-mkconfig -o /boot/grub/grub.cfg.

If you want that for some reason, just create it yourself, don’t install an AUR package. I could understand if it was a more substantial script but anyone can create a one-line script with zero skills required. There is no reason to have an AUR package for it.

6 Likes

I’ve got an alias for it: grup

What @dalto said, and this package hasn’t been updated since 2015, and the upstream URL doesn’t work. The package might be abandoned, or it might not need updates. It doesn’t look well kept.

Overall, just because something is in AUR doesn’t mean it’s good and works. Be careful.

As someone hurt by the past big grub issue, I updated as always with yay and didn’t run grub-install or grub-mkconfig, no problems.

I was ironic anyway :wink:

You’d be lucky so far. As the Arch dev is pulling grub from the Grub team’s feature main branch as that team works on the next release, there’s a pretty good change a future release will need both sides of grub updated.

Your streak just means that hasn’t happened yet.

Can I automate this process somehow? (I mean running the grub installation commands after every grub update)

Yes, you can use alpm hooks.

You just need to create a hook for grub-install. You could do something like this:

[Trigger]
Operation = Upgrade

Type = Package
Target = grub

[Action]
Description = Re-install grub on update
When = PostTransaction
Depends = grub
Exec = sh -c "grub-install --no-nvram && grub-mkconfig -o /boot/grub/grub.cfg"
6 Likes

Where should I place that though? (Sorry, I’m the best with hooks)

/etc/pacman.d/hooks/what-your-hook-is-named.hook

1 Like

Well, then you shouldn’t need any help… :sweat_smile:

/etc/pacman.d/hooks/grub.hook

Thanks!

1 Like

Does the hook have to be executable?

Also, this is another hook I use, Is it correct (I modified it to be like yours)

[Trigger]
Operation = Upgrade

Type = Package
Target = discord

[Action]
Description = Install OpenAsar...
When = PostTransaction
Depends = discord
Exec = sh -c "cd /opt/discord/resources/ && rm app.asar && wget https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar"
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.