package grub-efi-amd64 2.06-2ubuntu14.4 failed to install/upgrade: installed grub-efi-amd64 package post-installation script subprocess returned error exit status 127

Bug #2049691 reported by surendra
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2-unsigned (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

locus@locus-bloom:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-image-6.5.0-14-generic (6.5.0-14.14~22.04.1) ...
Setting up grub-pc (2.06-2ubuntu7.2) ...
/usr/sbin/update-grub: line 1: type.: command not found
dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
 grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
  Package grub-efi-amd64 is not installed.
  Package grub-pc is not configured yet.

dpkg: error processing package grub-efi-amd64-signed (--configure):
 dependency problems - leaving unconfigured
Processing triggers for linux-image-6.5.0-14-generic (6.5.0-14.14~22.04.1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                          /etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-6.5.0-14-generic
/etc/kernel/postinst.d/zz-update-grub:
run-parts: failed to exec /etc/kernel/postinst.d/zz-update-grub: Exec format error
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-6.5.0-14-generic (--configure):
 installed linux-image-6.5.0-14-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 grub-pc
 grub-efi-amd64-signed
 linux-image-6.5.0-14-generic
Error: Timeout was reached
E: Sub-process /usr/bin/dpkg returned an error code (1)

locus@locus-bloom:~$ sudo apt-get remove --purge linux-image-6.5.0-14-generic
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  amd64-microcode intel-microcode iucode-tool linux-headers-generic-hwe-22.04
  thermald
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  linux-generic-hwe-22.04* linux-image-6.5.0-14-generic*
  linux-image-generic-hwe-22.04*
0 upgraded, 0 newly installed, 3 to remove and 2 not upgraded.
3 not fully installed or removed.
After this operation, 14,3 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 200075 files and directories currently installed.)
Removing linux-generic-hwe-22.04 (6.5.0.14.14~22.04.7) ...
Removing linux-image-generic-hwe-22.04 (6.5.0.14.14~22.04.7) ...
Removing linux-image-6.5.0-14-generic (6.5.0-14.14~22.04.1) ...
I: /boot/vmlinuz is now a symlink to vmlinuz-5.19.0-32-generic
I: /boot/initrd.img is now a symlink to initrd.img-5.19.0-32-generic
/var/lib/dpkg/info/linux-image-6.5.0-14-generic.postrm ... removing pending trigger
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.5.0-14-generic
/etc/kernel/postrm.d/zz-update-grub:
run-parts: failed to exec /etc/kernel/postrm.d/zz-update-grub: Exec format error
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-6.5.0-14-generic (--remove):
 installed linux-image-6.5.0-14-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-6.5.0-14-generic
Processing was halted because there were too many errors.
Error: Timeout was reached
E: Sub-process /usr/bin/dpkg returned an error code (1)

locus@locus-bloom:~$ sudo apt-get remove --purge grub-pc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  amd64-microcode intel-microcode iucode-tool linux-headers-generic-hwe-22.04
  thermald
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  grub-efi-amd64
The following packages will be REMOVED:
  grub-gfxpayload-lists* grub-pc* linux-image-6.5.0-14-generic
The following NEW packages will be installed:
  grub-efi-amd64
0 upgraded, 1 newly installed, 3 to remove and 2 not upgraded.
3 not fully installed or removed.
Need to get 47,1 kB of archives.
After this operation, 14,7 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://se.archive.ubuntu.com/ubuntu jammy-updates/main amd64 grub-efi-amd64 amd64 2.06-2ubuntu14.4 [47,1 kB]
Fetched 47,1 kB in 6s (8 025 B/s)
Preconfiguring packages ...
(Reading database ... 200065 files and directories currently installed.)
Removing grub-gfxpayload-lists (0.7) ...
dpkg: grub-pc: dependency problems, but removing anyway as you requested:
 grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
  Package grub-efi-amd64 is not installed.
  Package grub-pc is to be removed.

Removing grub-pc (2.06-2ubuntu7.2) ...
Selecting previously unselected package grub-efi-amd64.
(Reading database ... 200043 files and directories currently installed.)
Preparing to unpack .../grub-efi-amd64_2.06-2ubuntu14.4_amd64.deb ...
Unpacking grub-efi-amd64 (2.06-2ubuntu14.4) ...
(Reading database ... 200047 files and directories currently installed.)
Removing linux-image-6.5.0-14-generic (6.5.0-14.14~22.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.5.0-14-generic
/etc/kernel/postrm.d/zz-update-grub:
run-parts: failed to exec /etc/kernel/postrm.d/zz-update-grub: Exec format error
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-6.5.0-14-generic (--remove):
 installed linux-image-6.5.0-14-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-6.5.0-14-generic
Processing was halted because there were too many errors.
Error: Timeout was reached
E: Sub-process /usr/bin/dpkg returned an error code (1)

locus@locus-bloom:~$ sudo ls -l /var/lib/dpkg/info | grep -i linux-image-6.5.0-14-generic
-rw-r--r-- 1 root root 0 jan 17 23:31 linux-image-6.5.0-14-generic.list
-rw-r--r-- 1 root root 248 nov 20 15:12 linux-image-6.5.0-14-generic.md5sums
-rwxr-xr-x 1 root root 2174 nov 20 15:12 linux-image-6.5.0-14-generic.postinst
-rwxr-xr-x 1 root root 1418 nov 20 15:12 linux-image-6.5.0-14-generic.postrm
-rwxr-xr-x 1 root root 453 nov 20 15:12 linux-image-6.5.0-14-generic.preinst
-rwxr-xr-x 1 root root 321 nov 20 15:12 linux-image-6.5.0-14-generic.prerm
-rw-r--r-- 1 root root 39 nov 20 15:12 linux-image-6.5.0-14-generic.triggers

locus@locus-bloom:~$ sudo mv /var/lib/dpkg/info/linux-image-6.5.0-14-generic.* /tmp

locus@locus-bloom:~$ sudo apt-get update
Hit:1 http://se.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://se.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:4 http://se.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:5 https://ppa.launchpadcontent.net/yannubuntu/boot-repair/ubuntu jammy InRelease
Error: Timeout was reached
Reading package lists... Done
locus@locus-bloom:~$ sudo apt-get update
Hit:1 http://se.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:3 http://se.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 https://ppa.launchpadcontent.net/yannubuntu/boot-repair/ubuntu jammy InRelease
Hit:5 http://se.archive.ubuntu.com/ubuntu jammy-backports InRelease
Error: Timeout was reached
Reading package lists... Done

locus@locus-bloom:~$ sudo apt-get remove --purge grub-pc
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  amd64-microcode intel-microcode iucode-tool linux-headers-generic-hwe-22.04
  thermald
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  grub-pc* linux-image-6.5.0-14-generic
0 upgraded, 0 newly installed, 2 to remove and 2 not upgraded.
3 not fully installed or removed.
After this operation, 14,3 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 200047 files and directories currently installed.)
Removing linux-image-6.5.0-14-generic (6.5.0-14.14~22.04.1) ...
dpkg: warning: ignoring request to remove grub-pc, only the config
 files of which are on the system; use --purge to remove them too
Setting up grub-efi-amd64 (2.06-2ubuntu14.4) ...
/usr/sbin/grub-install: line 1: g: command not found
/usr/sbin/grub-install: line 2: syntax error near unexpected token `('
/usr/sbin/grub-install: line 2: `Extended_description-no.utf-8: Filsystemet på ${PARTITION} som er tilordnet ${MOUNTPOINT} er ikke markert for formatering. Kataloger som inneholder systemfiler (/etc, /lib, /usr, /var, ...) og som allerede finnes under et hvilket som helst angitt monteringspunkt, vil bli slettet under installasjonen.\n\nForsikre deg om at du har tatt sikkerhetskopi av all verdifull data før du installerer.'
/usr/sbin/grub-install: line 1: g: command not found
/usr/sbin/grub-install: line 2: syntax error near unexpected token `('
/usr/sbin/grub-install: line 2: `Extended_description-no.utf-8: Filsystemet på ${PARTITION} som er tilordnet ${MOUNTPOINT} er ikke markert for formatering. Kataloger som inneholder systemfiler (/etc, /lib, /usr, /var, ...) og som allerede finnes under et hvilket som helst angitt monteringspunkt, vil bli slettet under installasjonen.\n\nForsikre deg om at du har tatt sikkerhetskopi av all verdifull data før du installerer.'
Trying to migrate /boot/efi into esp config
Installing grub to /boot/efi.
/usr/sbin/grub-install: line 1: g: command not found
/usr/sbin/grub-install: line 2: syntax error near unexpected token `('
/usr/sbin/grub-install: line 2: `Extended_description-no.utf-8: Filsystemet på ${PARTITION} som er tilordnet ${MOUNTPOINT} er ikke markert for formatering. Kataloger som inneholder systemfiler (/etc, /lib, /usr, /var, ...) og som allerede finnes under et hvilket som helst angitt monteringspunkt, vil bli slettet under installasjonen.\n\nForsikre deg om at du har tatt sikkerhetskopi av all verdifull data før du installerer.'
/usr/sbin/update-grub: line 1: type.: command not found
dpkg: error processing package grub-efi-amd64 (--configure):
 installed grub-efi-amd64 package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
 grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
  Package grub-efi-amd64 is not configured yet.
  Package grub-pc is not installed.

dpkg: error processing package grub-efi-amd64-signed (--configure):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.10.2-1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                     Errors were encountered while processing:
 grub-efi-amd64
 grub-efi-amd64-signed
Error: Timeout was reached
W: Can not find PkgVer for 'grub-pc'
E: Sub-process /usr/bin/dpkg returned an error code (1)

locus@locus-bloom:~$ sudo apt-get remove --purge grub-efi-amd64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  amd64-microcode intel-microcode iucode-tool linux-headers-6.5.0-14-generic
  linux-headers-generic-hwe-22.04 linux-hwe-6.5-headers-6.5.0-14
  linux-modules-6.5.0-14-generic linux-modules-extra-6.5.0-14-generic thermald
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  grub-gfxpayload-lists grub-pc
The following packages will be REMOVED:
  grub-efi-amd64*
The following NEW packages will be installed:
  grub-gfxpayload-lists grub-pc
0 upgraded, 2 newly installed, 1 to remove and 2 not upgraded.
2 not fully installed or removed.
Need to get 3 658 B/135 kB of archives.
After this operation, 431 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://se.archive.ubuntu.com/ubuntu jammy/main amd64 grub-gfxpayload-lists amd64 0.7 [3 658 B]
Fetched 3 658 B in 4s (822 B/s)
Preconfiguring packages ...
Selecting previously unselected package grub-gfxpayload-lists.
(Reading database ... 200047 files and directories currently installed.)
Preparing to unpack .../grub-gfxpayload-lists_0.7_amd64.deb ...
Unpacking grub-gfxpayload-lists (0.7) ...
dpkg: grub-efi-amd64: dependency problems, but removing anyway as you requested:
 grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
  Package grub-efi-amd64 is to be removed.
  Package grub-pc is not installed.

(Reading database ... 200058 files and directories currently installed.)
Removing grub-efi-amd64 (2.06-2ubuntu14.4) ...
(Reading database ... 200054 files and directories currently installed.)
Preparing to unpack .../grub-pc_2.06-2ubuntu7.2_amd64.deb ...
Unpacking grub-pc (2.06-2ubuntu7.2) ...
Setting up grub-gfxpayload-lists (0.7) ...
Setting up grub-pc (2.06-2ubuntu7.2) ...
/usr/sbin/update-grub: line 1: type.: command not found
dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
 grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
  Package grub-efi-amd64 is not installed.
  Package grub-pc is not configured yet.

dpkg: error processing package grub-efi-amd64-signed (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                     Processing triggers for man-db (2.10.2-1) ...
dpkg: dependency problems prevent processing triggers for shim-signed:
 shim-signed depends on grub-efi-amd64-signed (>= 1.187.2~) | grub-efi-arm64-signed (>= 1.187.2~); however:
  Package grub-efi-amd64-signed is not configured yet.
  Package grub-efi-arm64-signed is not installed.

dpkg: error processing package shim-signed (--configure):
 dependency problems - leaving triggers unprocessed
Errors were encountered while processing:
 grub-pc
 grub-efi-amd64-signed
 shim-signed
Error: Timeout was reached
E: Sub-process /usr/bin/dpkg returned an error code (1)

ProblemType: Package
DistroRelease: Ubuntu 22.04
Package: grub-efi-amd64 2.06-2ubuntu14.4
ProcVersionSignature: Ubuntu 5.19.0-32.33~22.04.1-generic 5.19.17
Uname: Linux 5.19.0-32-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.5
AptOrdering:
 linux-image-6.5.0-14-generic:amd64: Remove
 grub-pc:amd64: Purge
 NULL: ConfigurePending
 NULL: PurgePending
 NULL: ConfigurePending
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Wed Jan 17 23:36:23 2024
ErrorMessage: installed grub-efi-amd64 package post-installation script subprocess returned error exit status 127
Python3Details: /usr/bin/python3.10, Python 3.10.12, python3-minimal, 3.10.6-1~22.04
PythonDetails: N/A
RebootRequiredPkgs: Error: path contained symlinks.
RelatedPackageVersions:
 dpkg 1.21.1ubuntu2.2
 apt 2.4.11
SourcePackage: grub2-unsigned
Title: package grub-efi-amd64 2.06-2ubuntu14.4 failed to install/upgrade: installed grub-efi-amd64 package post-installation script subprocess returned error exit status 127
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
surendra (surendra-mum) wrote :
Revision history for this message
surendra (surendra-mum) wrote :

locus@locus-bloom:~$ sudo dpkg --configure -a
Setting up grub-pc (2.06-2ubuntu7.2) ...
/usr/sbin/update-grub: line 1: type.: command not found
dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error exit status 127
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
 grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
  Package grub-efi-amd64 is not installed.
  Package grub-pc is not configured yet.

dpkg: error processing package grub-efi-amd64-signed (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent processing triggers for shim-signed:
 shim-signed depends on grub-efi-amd64-signed (>= 1.187.2~) | grub-efi-arm64-signed (>= 1.187.2~); however:
  Package grub-efi-amd64-signed is not configured yet.
  Package grub-efi-arm64-signed is not installed.

dpkg: error processing package shim-signed (--configure):
 dependency problems - leaving triggers unprocessed
Errors were encountered while processing:
 grub-pc
 grub-efi-amd64-signed
 shim-signed

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Reviewing your log files attached to this bug report it seems that a package failed to install due to a segmentation fault in the application being used for the package installation process. Unfortunately, this bug report isn't very useful in its current state and a crash report would be much more useful. Could you try recreating this issue by enabling apport to catch the crash report 'sudo service apport start force_start=1' and then trying to install the same package again? This process will create a new bug report so I am marking this one as Invalid. Thanks again for helping out!

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: package-install-segfault
Changed in grub2-unsigned (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.