Can't upgrade to 24.04 LTS or install a clean version because of grub install script exit status 1 error

Ubuntu Version:

Kubuntu 24.04 LTS (clean install from Live USB), 22.04 LTS to 24.04 LTS (upgrade)

Desktop Environment (if applicable):

KDE Plasma

Problem Description:

Hello everyone. I’ve been trying to upgrade my old 22.04 LTS distro to 24.04 LTS for… well, the better part of 3 months now, and have been facing a lot of troubles.

I decided to reinstall Kubuntu from a live usb, and things go well until I am hit with the following error

Could not install 'grub-efi-amd64-signed'
The upgrade will continue but the grub-efi-amd64-signed" package may not be in a working state. Please consider submitting a bug report about it.

installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 1

I tried the following:

  • Installing 24.04 alongside 22.04 and a Windows install
  • Installing deleting 22.04 and installing 24.04 along with Windows
  • Wiping the entire drive and installing
  • Messing with my UEFI settings (disabling/enabling fast boot, disabling/enabling secure boot, etc)

And it always results in the same error. I made the decision of fixing my upgrade.

I created an account in this site and post my issues, and a user, 1fallen, helped me identify a couple of packages that were causing issues, the packages being both kubuntu-desktop and kubuntu-settings-desktop. Upon removal, install goes great until it starts messing with my grub, which results in the same error as before (installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 1).

I’m beginning to suspect that either my grub install is borked and should be reinstalled, or maybe my UEFI settings are somehow incorrect? Which is baffling because I hadn’t messed with them and 22.04’s original GRUB installed/is working fine.

Relevant System Information:

Laptop brand and model: Asus ROG Zephyrus M16 GU603HE
Grub version: grub-install (GRUB) 2.06-2ubuntu7.2
Grub config: Ubuntu Pastebin
LSBLK results:

francho@francho-ROG-Zephyrus-M16-GU603HE:~$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS

loop1         7:1    0  56,4M  1 loop /snap/aws-cli/1351
loop2         7:2    0     4K  1 loop /snap/bare/5
loop3         7:3    0 316,8M  1 loop /snap/code/185
loop4         7:4    0 316,8M  1 loop /snap/code/187
loop5         7:5    0  55,4M  1 loop /snap/core18/2846
loop6         7:6    0  55,4M  1 loop /snap/core18/2855
loop7         7:7    0  63,7M  1 loop /snap/core20/2434
loop8         7:8    0  63,7M  1 loop /snap/core20/2496
loop9         7:9    0  73,9M  1 loop /snap/core22/1748
loop10        7:10   0  73,9M  1 loop /snap/core22/1802
loop11        7:11   0  66,2M  1 loop /snap/core24/716
loop12        7:12   0  66,2M  1 loop /snap/core24/739
loop13        7:13   0 258,3M  1 loop /snap/firefox/5889
loop14        7:14   0 258,3M  1 loop /snap/firefox/5947
loop15        7:15   0 349,7M  1 loop /snap/gnome-3-38-2004/143
loop16        7:16   0 505,1M  1 loop /snap/gnome-42-2204/176
loop17        7:17   0   516M  1 loop /snap/gnome-42-2204/202
loop18        7:18   0  91,7M  1 loop /snap/gtk-common-themes/1535
loop19        7:19   0   173M  1 loop /snap/postman/254
loop20        7:20   0  44,4M  1 loop /snap/snapd/23545
loop21        7:21   0  44,4M  1 loop /snap/snapd/23771
loop22        7:22   0  56,5M  1 loop /snap/aws-cli/1371
nvme0n1     259:0    0 476,9G  0 disk 
├─nvme0n1p1 259:1    0   512M  0 part /boot/efi
├─nvme0n1p2 259:2    0 238,9G  0 part /var/snap/firefox/common/host-hunspell/
├─nvme0n1p3 259:3    0    16M  0 part 
└─nvme0n1p4 259:4    0 237,5G  0 part /media/francho/8CE4C815E4C80404

Screenshots or Error Messages:

Could not install 'grub-efi-amd64-signed'
The upgrade will continue but the grub-efi-amd64-signed" package may not be in a working state. Please consider submitting a bug report about it.

installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 1

What I’ve Tried:

Complete reinstall of OS from Live USB, while changing multiple UEFI and install settings
System upgrade from 22.04 LTS

Please try this:

apt -s install grub-efi-amd64-bin

Sure!

francho@francho-ROG-Zephyrus-M16-GU603HE:~$ apt -s install grub-efi-amd64-bin
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
grub-efi-amd64-bin is already the newest version (2.06-2ubuntu14.4).
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.

Hard to tell what’s going on, but if your using secureboot this needs to be installed mokutil
Now I see a bunch is still needed to complete the Upgrade:

sudo apt dist-upgrade

Any better?

I’ve tried installing mokutil and it’s already in there

francho@francho-ROG-Zephyrus-M16-GU603HE:~$ sudo apt install mokutil 
[sudo] password for francho: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
mokutil is already the newest version (0.6.0-2~22.04.2).
The following packages were automatically installed and are no longer required:
  linux-headers-5.15.0-134 linux-headers-5.15.0-134-generic linux-image-5.15.0-134-generic linux-modules-5.15.0-134-generic linux-modules-extra-5.15.0-134-generic
  linux-modules-nvidia-535-5.15.0-134-generic linux-objects-nvidia-535-5.15.0-134-generic linux-signatures-nvidia-5.15.0-134-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

And I used dist-upgrade and now everything is updated. I will prepare a new backup, just in case, and then try a new upgrade. Just to see where we’re at

Also give this a shot:

sudo apt install  --reinstall grub-efi-amd64-bin shim-signed

Then run sudo update-grub

I am currently restoring my laptop from another botched upgrade, I will try it as soon as I can!

To explain said botched upgrade: I left my computer do it’s thing, and I come to the same message I posted before (about how grub-efi-amd64-signed may not be in a working state because installed grub-efi-amd64-signed
package post-installation script
subprocess returned error exit status 1). It told me to try the following…

sudo dpkg -configure -a

… but it also told me the system might be unstable regardless. I was ready to boot into my recovery solution when I noticed that GRUB was working, and so, out of curiosity, booted into Kubuntu. I find that the system did indeed update, but several things were missing, like the driver manager and the network driver. Before booting into my recovery USB drive. I decide to try the dpkg command Kubuntu suggested, just to see what would happen. Here is the result

francho@francho-ROG-Zephyrus-N16-GU603HE:~$ sudo dpkg --configure -a
Setting up grub-efi-amd64-signed (1.202.2+2.12-1ubuntu7.1) ..
Installing grub to /boot/efi.
Installing for x86_64-efi platform.
grub-install: warning: Cannot set EFI variable Boot0002.
grub-install: warning: efivarfs_set_variable: writing to fd 9 failed: Invalid argument.
grub-install: warning: _efi_set_variable_mode: ops->set_variable() failed: Invalid argument.
grub-install: error: failed to register the EFI boot entry: Invalid argument.
Setting up shim-signed (1.58+15.8-0ubuntu1)
Installing grub to /boot/efi
Installing for x86_64-efi platform.
grub-install: warning: Cannot set EFI variable Boot0002.
grub-install: warning: efivarfs_set_variable: writing to fd 9 failed: Invalid argument.
grub-install: warning: _efi_set_variable_mode: ops->set_variable() failed: Invalid argument.
grub-install: error: failed to register the EFI boot entry: Invalid Argument

EDIT: I DID remember something, though. I believe, and that’s the word, BELIEVE, that some time before, this computer was installed with Secure Boot on. Now it is off, I don’t exactly remember why, though. Could this have something to do with this whole problem?

Ohhh, this is interesting! I get this error now

If I select “No”, this appears

On clicking OK, I’m taken to the original error message, and the cycle begins again. I can only exit if I click “Yes”

I read online that the program boot-repair might be helpful on diagnosing this issue. Here’s the resulting pastebin:

https://paste.ubuntu.com/p/x3bBBCkGXS/

As you can see, I enabled Secure boot to see if it changed anything. It did not. I then clicked “Repair boot” and got the following pastebin

https://paste.ubuntu.com/p/ghrmJ7kFWC/

Tried to use the command

sudo apt install --reinstall grub-efi-amd64-bin shim-signed

again, to no use

EDIT: Decided to try, to see if it would help, the “purge and reinstall GRUB” option of Boot-Repair, and the program told me to run a list of commands. I desisted after the second command didn’t work and cancelled the whole thing, but got the following message:

francho@francho-ROG-Zephyrus-M16-GU603HE:~$ sudo apt-get purge --allow-remove-essential -y grub-com*
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'grub-common' for glob 'grub-com*'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 shim-signed : Depends: grub-efi-amd64-signed (>= 1.187.2~) but it is not going to be installed or
                        grub-efi-arm64-signed (>= 1.187.2~) but it is not installable
               Depends: grub2-common (>= 2.04-1ubuntu24)
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

I decided to update my BIOS and now everything works as expected!

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.