package grub-pc 2.02~beta2-36ubuntu3.10 failed to install/upgrade: subprocess installed post-installation script returned error exit status 2

Bug #1692215 reported by Geoff Riley on 2017-05-20
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Undecided
Unassigned

Bug Description

On Ubuntu 16.04LTS. Automatic package updater indicated grub2 needed updating. When it finished it said there was a problem and asked if I wanted to report it. After clicking 'Report it' no further action was taken at that time. I have just rebooted, and the 'there was a problem' dialog box reappear, this time clicking 'Report it' elicited a password prompt and eventual display of this page.

My system appears, on the surface, to be working correctly at the moment, but I have not done much since the reboot.

Bug report #1692175 sounds similar but is for the efi version of grub.

Additional details:
$ lsb_release -rd
Description: Ubuntu 16.04.2 LTS
Release: 16.04
$ apt-cache policy grub2
grub2:
  Installed: (none)
  Candidate: 2.02~beta2-36ubuntu3.10
  Version table:
     2.02~beta2-36ubuntu3.10 500
        500 http://gb.archive.ubuntu.com/ubuntu xenial-proposed/universe amd64 Packages
     2.02~beta2-36ubuntu3.9 500
        500 http://gb.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
     2.02~beta2-36ubuntu3 500
        500 http://gb.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: grub-pc 2.02~beta2-36ubuntu3.10
ProcVersionSignature: Ubuntu 4.4.0-79.100-generic 4.4.67
Uname: Linux 4.4.0-79-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia_drm nvidia_modeset nvidia
ApportVersion: 2.20.1-0ubuntu2.6
Architecture: amd64
Date: Sat May 20 12:10:23 2017
DuplicateSignature:
 package:grub-pc:2.02~beta2-36ubuntu3.10
 Setting up grub-pc (2.02~beta2-36ubuntu3.10) ...
 /var/lib/dpkg/info/grub-pc.postinst: line 703: syntax error near unexpected token `fi'
 dpkg: error processing package grub-pc (--configure):
  subprocess installed post-installation script returned error exit status 2
ErrorMessage: subprocess installed post-installation script returned error exit status 2
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.4.0-79-generic root=UUID=8d5fb140-93f5-40ce-9e58-1d9abb865022 ro net.ifnames=0 biosdevname=0
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.2
 apt 1.2.21
SourcePackage: grub2
Title: package grub-pc 2.02~beta2-36ubuntu3.10 failed to install/upgrade: subprocess installed post-installation script returned error exit status 2
UpgradeStatus: Upgraded to xenial on 2016-08-03 (290 days ago)

Geoff Riley (geoffr) wrote :
tags: removed: need-duplicate-check
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
Jerry Bezencon (valtam) wrote :

Confirmed here. Looks like the postinst file has an extra 'fi' at line 703 of that file.

Ubuntu 16.04.2 base
grub-pc_2.02~beta2-36ubuntu3.10_amd64.deb package

Setting up grub-common (2.02~beta2-36ubuntu3.10) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Setting up grub2-common (2.02~beta2-36ubuntu3.10) ...
Setting up grub-pc-bin (2.02~beta2-36ubuntu3.10) ...
Setting up grub-pc (2.02~beta2-36ubuntu3.10) ...
/var/lib/dpkg/info/grub-pc.postinst: line 703: syntax error near unexpected token `fi'
dpkg: error processing package grub-pc (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up libssl-doc (1.0.2g-1ubuntu4.8) ...
Setting up libssl1.0.0:amd64 (1.0.2g-1ubuntu4.8) ...
Setting up libssl1.0.0:i386 (1.0.2g-1ubuntu4.8) ...
Setting up libssl-dev:amd64 (1.0.2g-1ubuntu4.8) ...
Setting up openssl (1.0.2g-1ubuntu4.8) ...
Setting up libxfont1:amd64 (1:1.5.1-1ubuntu0.16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu7) ...
/sbin/ldconfig.real: /usr/lib/nvidia-375/libEGL.so.1 is not a symbolic link

/sbin/ldconfig.real: /usr/lib32/nvidia-375/libEGL.so.1 is not a symbolic link

Errors were encountered while processing:
 grub-pc
E: Sub-process /usr/bin/dpkg returned an error code (1)

Geoff Riley (geoffr) wrote :

Correction suggested for efi version in LP: #1692175 comment #8 appears to also be a fix for this package.

Geoff Riley (geoffr) wrote :

To be clear on my previous comment, the fix recommended is adding a semicolon on line 699 of
  /var/lib/dpkg/info/grub-pc.postinst
(use sudo with your favourite text editor)

Changing:
  if dpkg --compare-versions "$2" lt-nl 2.02~beta2-36ubuntu3.10 then
into
  if dpkg --compare-versions "$2" lt-nl 2.02~beta2-36ubuntu3.10 ; then

…and then instructing pdkg to complete the configuration with:
  sudo dpkg --configure grub-pc

Jerry Bezencon (valtam) wrote :

Thanks Geoff. I can confirm that for Linux Lite (Ubuntu 16.04.2 base) the following fix worked:

sudo nano /var/lib/dpkg/info grub-pc.postinst

change line 699 from:

        if dpkg --compare-versions "$2" lt-nl 2.02~beta2-36ubuntu3.10 then
to
        if dpkg --compare-versions "$2" lt-nl 2.02~beta2-36ubuntu3.10; then

Then run:

sudo dpkg --configure grub-pc

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers