What can I do to fix this error on grub-efi?

Try

sudo apt-get purge grub\*
sudo apt-get install grub-efi
sudo apt-get autoremove
sudo update-grub

to fix.


In case someone's looking at setting up a multiboot USB disk to handle both mbr and grub:

If your current system is EFI, then you'll be missing this:

sudo apt install grub-pc-bin

If your current system is MBR, then you'll be missing this:

sudo apt install grub-efi-amd64-bin
# You may also need grub-efi-amd64-signed

The reference to /usr/lib/grub/i386-pc/modinfo.sh indicates a BIOS-mode GRUB install -- specifically, the i386-pc section of that path identifies the BIOS-mode version of GRUB. (For an EFI-mode installation on AMD64/x86-64, the equivalent path is /boot/grub/x86_64-efi/modinfo.sh.) OTOH, the package names clearly indicate an EFI-mode GRUB install. The two should not be mixed, but somehow that's happened in your case. Perhaps you've got a leftover GRUB configuration file from a previous BIOS-mode install, in which case tracking it down and updating it should fix the problem. Perhaps Boot Repair could fix the problem automatically. Note, however, that a repair attempt runs the risk of making matters worse by rendering your system unbootable. I therefore advise proceeding with extreme caution!

If you can't fix it easily, you could look into replacing GRUB with something else -- several alternatives are available, as described on this Web page of mine. GRUB 2 is the most difficult boot loader to tweak once it goes "off the rails," as yours has, which is why replacing it can be a good option. My own rEFInd boot manager is likely to be easy to install, with the caveat that there's an Ubuntu 16.04 bug that complicates installation from the PPA with Secure Boot active. (That's covered in the documentation.) Note also that simply installing a new package won't overcome your problem; you'd need to uninstall the GRUB package that's causing you difficulty to do that. I cover that topic specifically here, since it's not as easy as you might think. (Ubuntu keeps trying to re-install GRUB if you remove it.)

Tags:

Uefi

Grub2

16.04