Grub Hook to grub-install and grub-mkconfig?

Happily done and I am back.

Now I can say Grub updates will not cause me problems anymore (unless they change something else that causes another problem)

So, it is OK now. Nothing more needs to be done?

1 Like

Do you dual-boot(or plan to)? If not, you can uninstall os-prober.

1 Like

No way! Why should I if I am on EndeavourOS.
P.S. I dual booted only for one year when I first started Linux, just to feel safe.
After I was OK with Linux, there was no point in wasting disk space.

1 Like

Thanks @petsam
Sorry for late reply.

I believe leaving it would not hurt.
@dalto asked me (earlier post) to test my hook by “installing” Grub.
So, It won’t hurt if I leave it (I think).

Just for clarification and knowledge.
Install happens only when the package is not installed.
If the package is installed, you can’t re-install it, even if we use that term. It is actually a Sync/reSync operation (that’s what -S means :wink:

If you don’t have grub package installed, for some reason, then the Install trigger fires. Then, it starts to make no sense :smile: . When you really install (for the first time), you might want to run the grub-install command with certain required parameters, which is not the case when you run grub-install while grub is actually installed on $ESP.

If it looks confusing, it is because … it is! :rofl:

1 Like

Thanks for teaching me this.
I thought yay -S grub is the same whether installed or not.

Well, it can happen if I changed again to sytemd-boot, though I believe with this hook and current setup I will remain with Grub (unless they do something else) :rofl:

So far, for me the clueless non techie average Joe, this is what the whole Grub is about for me… confusing!

1 Like

I wonder if I should add
Target = linux
Target = linux-lts
2 Target lines or 1 having both?
Or it can be Target = linux*
Or should it be 2 other hooks?

I read in the forum that the 2 commands should be done if there is a kernel install, this means it applies to kernel update as well?

No, you only need to run grub-mkconfig if you don’t have a kernel as a boot option in your GRUB menu and you want to have it there.

I find it amazing how much effort you put into automatising things you do not understand. A tiny fraction of that effort is all that is needed to actually understand what “the 2 commands” do, so you know exactly when to run them…


I’ll take this as the answer.
I said many times I am not a techie and not a developer. I am just a user who tries to get the best out of his system.

Thanks anyway!

No, because you don’t want to reinstall grub on kernel changes.

If you want hooks for handling kernel changes, you can install grub-hook from the AUR.

To be fair, those are only needed if you regularly install and remove different kernels.

You don’t need to be a techie or a developer to understand what grub-mkconfig does and when you need to run it. It is very simple.

1 Like

Personally, for my own use case, I tend not to automatizing a procedure before I fully grasp what will be happening and why.

As an example, even though there is a convenient systemd service to clean the package cache, I just use the command line: paccache. It gives me a sense of being more “in control” when I see the terminal output.


Thanks a lot @dalto for the focused, clear, and to the point reply as usual.
I thought it was required because -as I mentioned- in many threads I read about it in case of kernel install. (which is not the case for me)

I have only the “default” kernel plus the LTS kernel. I do not play with kernels, install and reinstall…

Again, thank you for this. I am just a user.

Thank you very much for your patience and kind attitude with an average Joe!
Thank you very much.

These shouldn’t be an excuse to not read the documentation and to not learn new stuff. Most people are just users
I am a relatively new Linux user (around an year). The way learn about these things is to read, read and read more.
Give it a try

1 Like

Thanks a lot @peback
For me as a non techie all I know is that these 2 commands are required to be sure (almost) Grub will not do it again. Details on how they do it, no thanks, not for me.

To me they are like checking with the Avometer (or any other way) that the batteries are dead, they need replacement, where is the +ve, where is the -ve, just do it without needing to know what is the difference between Volt and Ampere, what is the difference between a Lithium or Zinc cells! It is just enough for me to see the Avo. doesn’t read so it is dead, and read the +ve and -ve signs.

So, the logic was clear I hope in the other thread in the script I made, based on simple understanding of the issue if there is Grub update you better do command x and command y.
I believe it saved me anyway as I read some had issues because of the update as they had before, or maybe I was just lucky.

@dalto kindly explained why is it better to do a hook, so I just followed and tried here in this thread, which ended up successfully with the help of all of you who posted here.

Thank you all for all the help, support and patience.

1 Like

What about this: Simply uninstall the grub package. (I mean the package, not the already installed boot-loader)

All problems solved. :smiley:
(assuming you can live with not getting (security-)updates for grub.)

In case you want to install another kernel (which should not really happen that often I would assume), simply update grub.cfg manually (it shouldn’t be too hard to copy paste one of those menuentry sections and adapt the initrd and linux references)


Thank you @sradjoker
I promise I will do my best.
I hope you noticed my first post here where I said I read this and that to know how to make a hook.

But I always prefer to ask the experts -even if I think I know perfectly- when it comes to a critical thing like a boot loader or kernel.

I assure you I am not making excuses and assure you as well I am eager to learn as much as I can.

Thanks to you all I have already learned a lot (a lot for me), I never knew there is something called hooks initially! This is just the latest I learned.

These two statements seem pretty contradictory to me…


For me to learn more, can you please explain to me how is uninstalling grub is not uninstalling the bootloader! How is that?!

Well, for me, 2 things I will never ever play with, it gets installed once and that’s it, the boot loader and the kernel.

“grub the package” is used to install “grub the bootloader”. That is what grub-install does.

In theory, once you run grub-install, you could remove “grub the package”.

To be fair, I think that is an extreme solution. :cowboy_hat_face:


Would you believe me if I said when I read your post they seemed really contradictory to me! Me who said the two statements!

Allow me to explain.
I am eager to know and learn how neurosurgeons do their surgeries, what tools, what cases,… maybe how a submarine works, how satellites stay in orbit, where they get energy from, how they “communicate” with NASA.

But knowing how is the communication circuit designed, what components… this is not my field!

This is how I am eager to learn and not eager to learn at the same time.
(Eager to know something about everything, or everything about something, but it would be crazy to try to know everything about everything) Though whenever I try to know everything about something I only know that I know much less than what I thought.

Still sounds contradictory?!
I am enjoying the conversation with you guys cause you are smart. I like it.