Apt update fails on package grub-pc. package grub-efi-amd64 (not installed) failed to install/upgrade: installed grub-efi-amd64 package post-installation script subprocess returned error exit status 128

Asked by Jarrod

I tried the first 3 methods in the following article to no avail:
https://itsfoss.com/dpkg-returned-an-error-code-1/

dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error exit status 20
Errors were encountered while processing:
 grub-pc
E: Sub-process /usr/bin/dpkg returned an error code (1)

ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: grub-efi-amd64 (not installed)
ProcVersionSignature: Ubuntu 5.13.0-1021.24~20.04.1-azure 5.13.19
Uname: Linux 5.13.0-1021-azure x86_64
ApportVersion: 2.20.11-0ubuntu27.21
AptOrdering:
 grub-gfxpayload-lists:amd64: Remove
 grub-pc:amd64: Remove
 grub-efi-amd64:amd64: Install
 NULL: ConfigurePending
Architecture: amd64
CasperMD5CheckResult: skip
Date: Sun Apr 10 08:46:57 2022
DpkgTerminalLog:
 Preparing to unpack .../grub-efi-amd64_2.04-1ubuntu44.2_amd64.deb ...
 Unpacking grub-efi-amd64 (2.04-1ubuntu44.2) ...
 Setting up grub-efi-amd64 (2.04-1ubuntu44.2) ...
 dpkg: error processing package grub-efi-amd64 (--configure):
  installed grub-efi-amd64 package post-installation script subprocess returned error exit status 128
ErrorMessage: installed grub-efi-amd64 package post-installation script subprocess returned error exit status 128
InstallationDate: Installed on 2022-01-29 (70 days ago)
InstallationMedia: Ubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
Python3Details: /usr/bin/python3.8, Python 3.8.10, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: N/A
RelatedPackageVersions:
 dpkg 1.19.7ubuntu3
 apt 2.0.6
SourcePackage: grub2-unsigned
Title: package grub-efi-amd64 (not installed) failed to install/upgrade: installed grub-efi-amd64 package post-installation script subprocess returned error exit status 128
UpgradeStatus: No upgrade log present (probably fresh install)

Question information

Revision history for this message
Erich Eickmeyer (eeickmeyer) said :
#1

Thank you for taking the time to report this issue and helping to make Ubuntu better. Examining the information you have given us, this does not appear to be a bug report so we are closing it and converting it to a question in the support tracker. We understand the difficulties you are facing, but it is better to raise problems you are having in the support tracker at https://answers.launchpad.net/ubuntu if you are uncertain if they are bugs. You can also find help with your problem in the support forum of your local Ubuntu community http://loco.ubuntu.com/ or asking at https://askubuntu.com or https://ubuntuforums.org. For help on reporting bugs, see https://help.ubuntu.com/community/ReportingBugs.

Revision history for this message
Manfred Hampl (m-hampl) said :
#2

Your output is somewhat contradictory:

dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error exit status 20

dpkg: error processing package grub-efi-amd64 (--configure):
  installed grub-efi-amd64 package post-installation script subprocess returned error exit status 128

That's two different packages and two different error codes.
What is the output of the command

apt-cache policy grub-pc grub-efi-amd64
dpkg -l grub-pc grub-efi-amd64

Revision history for this message
Jarrod (jrod840) said :
#3

Hi, sorry I don't mean to take up anyones time with this, it was a lab VM that I was running so I've redeployed it. Ubuntu picked this up as a bug and asked for me to add a summary, quite frankly I have no idea what happened.

Revision history for this message
Bernard Stafford (bernard010) said :
#4

If the same thing happens again [being reproduced] then file a new bug report.
--configure means that you need to configure the package in question.
And as : https://launchpad.net/~m-hampl replied: out put the command from terminal.

Revision history for this message
Manfred Hampl (m-hampl) said (last edit ):
#5

@Bernard: Why did you remove the bug link? This question and that bug report belong together and that's what the links is for.