Executing sudo apt upgrade or installing a new Linux kernel on an Ubuntu system only to have the process crash with the fatal error “installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 1” locks the APT package management database. In modern UEFI-based Ubuntu installations, grub-efi-amd64 updates the EFI bootloader binary on the physical ESP partition. When the EFI partition is unmounted, out of disk space, corrupted by bad FAT32 sectors, or blocked by NVRAM write limits, the GRUB post-installation script aborts.
Verify and Remount the EFI System Partition (/boot/efi)
The most frequent reason the GRUB post-install script fails with exit code 1 is that the UEFI boot partition (/boot/efi) is not currently mounted or is mounted in read-only mode.
- Open a Terminal window (press Ctrl + Alt + T).
- Check if the EFI partition is actively mounted:
df -h /boot/efi - If the output does not show an active FAT32 volume mounted at
/boot/efi, check your filesystem table:cat /etc/fstab | grep efi - Attempt to mount all filesystems defined in fstab:
sudo mount -a - If mounting fails with a read-only or corrupted error, force a file system check on the EFI partition:
(Replacesudo dosfsck -w -r /dev/sda1/dev/sda1or/dev/nvme0n1p1with your actual EFI partition identifier fromlsblk). - Mount the partition cleanly and proceed to reconfigure the package.
Check for Full /boot and /boot/efi Partitions
An EFI System Partition (ESP) typically has a modest capacity (between 100 MB and 500 MB). Stale kernel images or leftover EFI boot files can fill the partition to 100% utilisation.
- Check available disk space on the boot filesystems:
df -h /boot /boot/efi - If
/boot/efiindicates 100% Use, inspect the files taking up space:sudo ls -la /boot/efi/EFI/ - Remove obsolete vendor folders from previous Linux distributions or uninstalled dual-boot operating systems.
- Purge retired Linux kernels from
/boot:sudo apt autoremove --purge -y
Manually Install GRUB to the EFI Partition
Reinstalling the GRUB UEFI binaries manually reconstructs necessary EFI directory trees and regenerates bootloader keys.
- Verify your physical root disk identifier by running
lsblk. - Execute the manual GRUB installation command targeting your primary drive:
(For NVMe drives, usesudo grub-install /dev/sdasudo grub-install /dev/nvme0n1). - If successful, update the GRUB configuration file:
sudo update-grub
Reconfigure Pending DPKG Packages
Once the EFI environment is functional, instruct dpkg to complete the interrupted package transactions.
- In Terminal, execute the database configuration command:
sudo dpkg --configure -a - Ensure that
grub-efi-amd64andgrub-efi-amd64-signedconfigure without reporting errors. - Run a dependency verification:
sudo apt --fix-broken install - Perform a final update:
sudo apt update && sudo apt upgrade -y
Clear Full UEFI NVRAM Boot Variables
Certain motherboard UEFI firmwares have buggy NVRAM implementations that refuse new boot entries when variables become cluttered.
- Install the efibootmgr tool:
sudo apt install -y efibootmgr - List existing boot entries:
sudo efibootmgr - Delete redundant or stale boot entries:
(Replacesudo efibootmgr -b XXXX -BXXXXwith the boot entry number). - Reinstall GRUB and reconfigure dpkg.