package grub-pc 2.04-1ubuntu26 failed to install/upgrade: installed grub-pc package post-installation script subprocess returned error exit status 1

Bug #1876943 reported by Scott Stensland
36
This bug affects 7 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

this happened on first apt-get install upgrade after fresh Ubuntu 20.04 install from scratch not any update

lsb_release -rd
Description: Ubuntu 20.04 LTS
Release: 20.04

apt-cache policy grub2
grub2:
  Installed: (none)
  Candidate: 2.04-1ubuntu26
  Version table:
     2.04-1ubuntu26 500
        500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages

uname -m && uname -r && cat /etc/*release
x86_64
5.4.0-14-generic
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04 LTS"
NAME="Ubuntu"
VERSION="20.04 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04 LTS"
VERSION_ID="20.04"

ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: grub-pc 2.04-1ubuntu26
ProcVersionSignature: Ubuntu 5.4.0-14.17-generic 5.4.18
Uname: Linux 5.4.0-14-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
Date: Tue May 5 10:28:31 2020
ErrorMessage: installed grub-pc package post-installation script subprocess returned error exit status 1
InstallationDate: Installed on 2020-05-05 (0 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Alpha amd64 (20200309)
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.4.0-14-generic root=UUID=2a498b8e-c1b0-4cb8-9440-fccd950ec4ff ro quiet splash vt.handoff=7
Python3Details: /usr/bin/python3.8, Python 3.8.2, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: N/A
RelatedPackageVersions:
 dpkg 1.19.7ubuntu3
 apt 2.0.2
SourcePackage: grub2
Title: package grub-pc 2.04-1ubuntu26 failed to install/upgrade: installed grub-pc package post-installation script subprocess returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Scott Stensland (scottstensland) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in grub2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Douglas E Engert (dengert) wrote :

Running VirtualBox 6.1 on Windows 10, I cloned Xubuntu 18.04 VM to new ssd and resized the .vhd which ran gparted to move swap are resizing the root partition. Then upgraded to 20.04. This caused all sorts of problems and I followed: https://askubuntu.com/questions/1231849/how-to-fix-update-problems-ubuntu-20-04
to get a running system.

I got the following before and continue to get it even after following the above URL:
  "installed grub-pc package post-installation script subprocess returned error exit status 1"
when anything is installed.

By modiging /var/lib/dpkg/info/grub-pc.postinst:
-- grub-pc.postinst.dee.orig 2020-09-26 14:04:44.012323484 -0500
+++ grub-pc.postinst 2020-09-26 14:05:50.028324633 -0500
@@ -1,6 +1,8 @@
 #!/bin/bash
 set -e
-
+PS4='Line ${LINENO}: '
+set -x
+set -v
 # Apply a sed expression using extended regular expressions in place to a
 # file, if it exists. The file is the first argument in order to work
 # neatly with apply_conf_tweaks.

Then running:
sudo dpkg --configure -a
The last few lines are:

Line 677: '[' true = false ']'
Line 680: db_input critical grub-pc/install_devices_empty
Line 66: _db_cmd 'INPUT critical' grub-pc/install_devices_empty
Line 42: _db_internal_IFS='
'
Line 43: IFS=' '
Line 44: printf '%s\n' 'INPUT critical grub-pc/install_devices_empty'
Line 47: IFS='
'
Line 48: read -r _db_internal_line
Line 49: IFS='
'
Line 52: RET='30 question skipped'
Line 53: case ${_db_internal_line%%[ ]*} in
Line 59: return 30
Line 690: exit 1
rm -f /tmp/grub.ekWa3OkQHZ
Line 1: rm -f /tmp/grub.ekWa3OkQHZ
dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 grub-pc

-----
This shows problem is with "grub-pc/install_devices_empty"

I can provide other debugging info, or test a fix if that would help.

Revision history for this message
Jan Schilder (jgm-schilder) wrote :

The error came before ending and promised that the upgrade would continue. But a few minutes later there was a crash and it said that the installation was to be rolled back. But the running version 18.04 LTS appeared not to work any more. Now I am stuck.

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.