53

I have a MacBook Pro and only use Ubuntu on it. I just upgraded from 18.04 to 20.04.

Now when I start the computer it says:

Failed to Set MokListRT: Invalid Parameter
Could not create mokListRT: Invalid Parameter
Importing MOK states has failed: import_mok_state() failed: Invalid Parameter
Continuing boot since secure mode is disabled.

Does anyone know EXACTLY how I can fix this?? Step-by-step process I don't want to mess anything up trying to fix this.

karel
  • 114,770
  • For reference, here is a bug report. – Alexey Nov 06 '20 at 10:23
  • A possible duplicate with an accepted answer: How do I fix broken boot after shim update?. – Alexey Nov 06 '20 at 10:27
  • 2
    I answered this question at https://askubuntu.com/a/1299955/389062. Your question is pretty much a duplicate of the one that was asked there, except that in your case you see the MOK List error message while the other question only mentions a blinking _ instead of the MOK List error message. But the source of the problem is fundamentally the same: shimx64.efi (a signed / "MOKlisted" Secure Boot version of grubx64.efi) being used in a computer whose EFI's Secure Boot mode is disabled and, therefore, requires grubx64.efi instead. – Yuri Sucupira Dec 14 '20 at 11:33
  • I had a similar issue with my 13" mid-2009 Apple Macbook Pro and solved it by doing what I explain here – Yuri Sucupira Jan 06 '21 at 12:21

3 Answers3

56

You have to replace shimx64.efi with grubx64.efi as follows:

sudo su -
cd /boot/efi/EFI/ubuntu
cp grubx64.efi shimx64.efi
reboot
Shibiwan
  • 569
  • 3
  • 2
  • 1
    Point of reference for others. This does not work for the same error message on a 2010 iMac (coreDuo). The error may be more subtle or the older machine may need an even older version of grub. – Jonathan Gutow Oct 10 '20 at 00:55
  • 1
    this works also on MacBook Air 2015 model, You are awesome sir, thank you – GGEv Oct 18 '20 at 16:11
  • 1
    In KDE neon, the directory named above exists but does not contain the files. They are in /boot/efi/EFI/neon. i removed packages shim and shim-signed afterwards. – mak Nov 22 '20 at 21:06
  • 11
    This fix works, but only until the next system update re-installs shimx64.efi. The "permanent" fix for me was to remove "shim" and "shim-signed" (sudo apt remove --purge shim shim-signed) and then reinstall-grub (sudo update-grub2). – Thomas Perl Dec 05 '20 at 11:46
  • 2
    How do I do this if I can't boot into an OS with a shell? I'm just stuck in a grub shell – lennartVH01 Feb 08 '21 at 11:28
  • 1
    @lennartVH01 same with me. I am stuck on the ubuntu logo. – Linux Geek Mar 29 '21 at 10:15
  • This worked for ubuntu 21.04 on a thinkpad – lordvcs Apr 28 '21 at 07:41
  • 1
    @ThomasPerl: Thanks for this, I tried your commands and they seemed to work fine, but there's no change. (I can still boot just like before, but I also still get the "Failed..." message.) To clarify, is this something you should run after/in addition to the other instructions, or instead? (FWIW: Ubuntu Server 20.04.2, Mac Mini late 2009.) – Pete Forsyth May 13 '21 at 16:46
  • As asked before, how to enter shell if OS doesn't boot in. I see Ubuntu purple screen and a mouse cursor, and can do nothing. – jangorecki Aug 03 '22 at 13:01
10

This is caused by Bug #1867092 and the proposed workaround (see comment #23) is:

apt-get purge shim
grub-install /dev/sda1 #replace sda1 with the correct grub partition for you

That solution worked for me.

Note that the best voted answer to this question, which is copying grubx64.efi over shimx64.efi, will be undone with each shim update according to that bug page.

Jaydin
  • 1,446
  • This worked great for me – Mr.Young May 16 '21 at 11:01
  • I tried sudo update-grub2 /dev/sda1 (as mentioned in a comment to another answer), but that did not work. sudo grub-install /dev/sda1 (as specified in this answer) did the trick though. – zrajm May 24 '21 at 11:14
9

Solution that works on my 2010 iMac. Install rEFInd and make sure to boot from the option that specifies grubx64.efi.

Jonathan Gutow
  • 351
  • 2
  • 4
  • 1
    This worked and it was as simple as sudo apt install refind . – hackerb9 Feb 18 '21 at 00:40
  • 1
    well the message MokListRT: Invalid Parameter disappear by installing reFind, I still not sure this is the best solution, as my system is not multi-OS, reFind is simply useless otherwise than hidding the message. – JOduMonT Mar 18 '21 at 17:40