[SOLVED] Latest grub2 update won't run grub2-install on UEFI machines

Issues related to applications and software problems and general support
Post Reply
scottro
Forum Moderator
Posts: 2553
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

[SOLVED] Latest grub2 update won't run grub2-install on UEFI machines

Post by scottro » 2021/01/31 17:32:32

I have a laptop that I multiboot. CentOS was the first system installed, and I've always used its grub because I've found its grub to be better at booting FreeBSD, which also shares this laptop.
I install various systems, which often install their own grub. I might, for example, install Ubuntu, tell it to put grub in the Ubuntu partition, but upon reboot, Ubuntu's grub has taken over. No problem, I boot back into CentOS (this is using 8.3-stream) and reinstall grub.

Until now. The grub2 2.02-93 gives a message. Cannot install on UEFI systems and something about not being able to handle secure boot.
As the first thing I do on a laptop is remove Windows and disable secure boot, this made little sense to me. The interesting thing, to me, is that if I reinstall, it will reinstall grub, and boot from the CentOS grub. And, even if I put the exact error into a web search, there are, as of now, no results. I'm not sure when it went from 2.02-90 to 2.02-93. On my tower, it shows that 2.02-93 was installed January 21st.

I suspect most people won't even notice it. It's only an issue for me because its grub does well at booting FreeBSD, and I don't even need that on this T95 Thinkpad, I can hit F12 at boot and FreeBSD shows up as an option to boot, and I can boot it that way. I know there are myriads of ways to work around this, and if I had just wiped Windows, and changed BIOS (as I have) to UEFI only, and installed CentOS, I wouldn't even have noticed. It just seems one of those aggravating things that will supposedly make something more secure.

I could rant on about it, but anyway, grub2-common-2.02-93.el8.noarch.rpm will, if one runs grub2-install, fail to install on a UEFI system. This only affects a few people, I suppose, since, as mentioned, it will install and boot from grub. I've always, on UEFI machines, been able to use

Code: Select all

grub2-install --target=x86_64 -efi --efi-directory=/boot/efi --bootloader-id=centos
, so figured I would pass this on in case anyone else is affected.
For me, the fix was to go to a mirror (being in Manhattan, I used mirror.nyi.net as I have friends there and now I can say, Hey, used your mirror the other day, and got the need grub2-2.02-90 packages that I needed, I'm not sure which ones I didn't actually need, but I installed grub2-common, grub2-tools, grub2-tools-extra, grub2-tools-mininal (I think extra was required for grub2-common, and extra required minimal, IIRC), grub2-efi (not sure if I needed that), and grub2-efi-x64-modules, which, if I didn't that, gave me the error about not finding modinfo.sh

I don't think I can even call this a bug, because I don't know how many people actually have to run grub2-install on a UEFI machine (as opposed to having grub2 installed when installing CentOS.

However, there are probably a few corner cases besides myself who might be affected.
New users should check the FAQ and Read Me First pages

scottro
Forum Moderator
Posts: 2553
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: Latest grub2 update won't run grub2-install on UEFI machines

Post by scottro » 2021/03/08 13:34:44

In the interests of completeness, I should add that after some changes I made in the grub configuration for FreeBSD, I was able to update grub and have it work perfectly So, again, this is something that would only affect very few in the first place, and can now be ignored. I've marked it solved for posterity.
New users should check the FAQ and Read Me First pages

scottro
Forum Moderator
Posts: 2553
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: [SOLVED] Latest grub2 update won't run grub2-install on UEFI machines

Post by scottro » 2021/03/13 01:40:32

And once again, in interest of completeness, I was wrong again. Upgrading Grub did prevent me from reinstalling, giving the error message I mentioned. I had to once again downgrade to 2-2.02-90
New users should check the FAQ and Read Me First pages

Post Reply