I get this error when trying to install Ubuntu to ANY drive using a 2019 Macbook Pro 16-inch, whether it's on an external USB thumb drive, and external SSD, or the internal SSD. I tried installing to an external USB with 18.04, since that version doesn't recognize the the Apple NVME drive.
Sometimes the error is:
Skipping unreadable variable "Boot0000": Interrupted system call
Could not prepare Boot variable: Invalid argument
grub-install: error: efibootmgr failed to register the boot entry: Input/output error.
The USB stick is formatted as GPT with an EFI partition everything.
I'm trying install Ubuntu to this MacBook Pro with a more recent kernel, because the RE nvme driver was mailined in during kernel v5.4. However this error prevents installing and upgrading certain packages and they all spit out this error, no matter what I'm installing. Is this because Apple is doing something funky yet again?
I also tried focal fossa (20.04) which CAN recognize the Apple NVME drive and still get errors related to the *-signed packages (ie, shim-signed).