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

Bug #1783562 reported by Tarciso Junior
40
This bug affects 8 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

This error come up every time I start my system.

ProblemType: Package
DistroRelease: Ubuntu 18.04
Package: grub-pc 2.02-2ubuntu8.2
ProcVersionSignature: Ubuntu 4.15.0-29.31-generic 4.15.18
Uname: Linux 4.15.0-29-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.2
Architecture: amd64
Date: Tue Jul 24 20:46:47 2018
DuplicateSignature:
 package:grub-pc:2.02-2ubuntu8.2
 Setting up unattended-upgrades (1.1ubuntu1.18.04.5) ...
 dpkg: error processing package unattended-upgrades (--configure):
  installed unattended-upgrades package post-installation script subprocess returned error exit status 10
ErrorMessage: installed grub-pc package post-installation script subprocess returned error exit status 10
InstallationDate: Installed on 2018-03-14 (132 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20180105.1)
ProcCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.15.0-29-generic root=UUID=2d103f0a-4c1b-4b58-9ce0-f4b78f65a235 ro quiet splash
Python3Details: /usr/bin/python3.6, Python 3.6.5, unpackaged
PythonDetails: /usr/bin/python2.7, Python 2.7.15rc1, unpackaged
RelatedPackageVersions:
 dpkg 1.19.0.5ubuntu2
 apt 1.6.3
SourcePackage: grub2
Title: package grub-pc 2.02-2ubuntu8.2 failed to install/upgrade: installed grub-pc package post-installation script subprocess returned error exit status 10
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Tarciso Junior (tsjabrantes) 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
Phillip Susi (psusi) wrote :

Please open a terminal and do the following:

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

In the editor, change the first line from "set -e" to "set -ex", then save and exit. Then run sudo apt-get install -f and post the output.

Changed in grub2 (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Nikolay Savelev (nik-weter) wrote :
Download full text (4.3 KiB)

Настраивается пакет grub-pc (2.02-2ubuntu8.2) …
+ cached_available_ids=
+ case "$1" in
+ . /usr/share/debconf/confmodule
++ '[' '!' '' ']'
++ PERL_DL_NONLAZY=1
++ export PERL_DL_NONLAZY
++ '[' '' ']'
++ exec /usr/share/debconf/frontend /var/lib/dpkg/info/grub-pc.postinst configure 2.02-2ubuntu8
+ cached_available_ids=
+ case "$1" in
+ . /usr/share/debconf/confmodule
++ '[' '!' 1 ']'
++ '[' -z '' ']'
++ exec
++ '[' '' ']'
++ exec
++ DEBCONF_REDIR=1
++ export DEBCONF_REDIR
+ devicemap_regenerated=
+ egrep -q '^[[:space:]]*post(inst|rm)_hook[[:space:]]*=[[:space:]]*(/sbin/|/usr/sbin/)?update-grub' /etc/kernel-img.conf
+ case grub-pc in
+ mkdir -p /boot/grub
+ test -e /boot/grub/device.map
+ test -z ''
+ test -s /boot/grub/device.map
+ test -z ''
+ dpkg --compare-versions 2.02-2ubuntu8 lt-nl 1.99~20101210-2
++ mktemp -t grub.XXXXXXXXXX
+ tmp_default_grub=/tmp/grub.Q94e5IZZXU
+ trap 'rm -f /tmp/grub.Q94e5IZZXU' EXIT
+ cp -p /usr/share/grub/default/grub /tmp/grub.Q94e5IZZXU
+ merge_debconf_into_conf /tmp/grub.Q94e5IZZXU GRUB_CMDLINE_LINUX grub2/linux_cmdline
+ local tmpfile
+ tmpfile=/tmp/grub.Q94e5IZZXU
+ local setting
+ setting=GRUB_CMDLINE_LINUX
+ local template
+ template=grub2/linux_cmdline
+ db_get grub2/linux_cmdline
+ _db_cmd 'GET grub2/linux_cmdline'
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'GET grub2/linux_cmdline'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET=
+ case ${_db_internal_line%%[ ]*} in
+ return 0
+ local value
++ echo ''
++ sed -e 's,[$`"\],\\&,g'
+ value=
+ grep -q '^GRUB_CMDLINE_LINUX=' /tmp/grub.Q94e5IZZXU
++ echo ''
++ sed -e 's,[\@],\\&,g'
+ value=
+ sed -i -re 's@^(GRUB_CMDLINE_LINUX=).*@\1""@' /tmp/grub.Q94e5IZZXU
+ merge_debconf_into_conf /tmp/grub.Q94e5IZZXU GRUB_CMDLINE_LINUX_DEFAULT grub2/linux_cmdline_default
+ local tmpfile
+ tmpfile=/tmp/grub.Q94e5IZZXU
+ local setting
+ setting=GRUB_CMDLINE_LINUX_DEFAULT
+ local template
+ template=grub2/linux_cmdline_default
+ db_get grub2/linux_cmdline_default
+ _db_cmd 'GET grub2/linux_cmdline_default'
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'GET grub2/linux_cmdline_default'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET='quiet splash'
+ case ${_db_internal_line%%[ ]*} in
+ return 0
+ local value
++ echo 'quiet splash'
++ sed -e 's,[$`"\],\\&,g'
+ value='quiet splash'
+ grep -q '^GRUB_CMDLINE_LINUX_DEFAULT=' /tmp/grub.Q94e5IZZXU
++ echo 'quiet splash'
++ sed -e 's,[\@],\\&,g'
+ value='quiet splash'
+ sed -i -re 's@^(GRUB_CMDLINE_LINUX_DEFAULT=).*@\1"quiet splash"@' /tmp/grub.Q94e5IZZXU
+ case grub-pc in
+ merge_debconf_into_conf /tmp/grub.Q94e5IZZXU GRUB_TIMEOUT grub-pc/timeout
+ local tmpfile
+ tmpfile=/tmp/grub.Q94e5IZZXU
+ local setting
+ setting=GRUB_TIMEOUT
+ local template
+ template=grub-pc/timeout
+ db_get grub-pc/timeout
+ _db_cmd 'GET grub-pc/timeout'
+ _db_internal_IFS='
'
+ IFS=' '
+ printf '%s\n' 'GET grub-pc/timeout'
+ IFS='
'
+ IFS='
'
+ read -r _db_internal_line
+ RET=10
+ case ${_db_internal_line%%[ ]*} in
+ return 0
+ local value
++ sed -e 's,[$`"\],\\&,g'
++ echo 10
+ value=10
+ grep -q '^GRUB_TIMEOUT=' /tmp/grub.Q94e5IZZXU
++ echo 10
++ sed -e 's,[\@],\\&,g'
+ value=10
+ sed -i -re 's@^(GRUB_TIMEOUT=).*@\1"10"...

Read more...

Revision history for this message
Phillip Susi (psusi) wrote :

Thanks Nikolay. Are you sure that grep -v line was the very last line? I don't see how the script can possibly error out at that point.

Changed in grub2 (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
nurbawono (auliajati) wrote :

it's also buggy in Ubuntu Ubuntu 16.04.5 LTS. I solve with remove or modifying name of grub-pc.postinst to grub-pc.postinst.buggy. But sometimes if you update your ubuntu, the grub-pc.postinst is back to /var/lib/dpkg/info, and you're getting same error.

Revision history for this message
Jürgen (jurgen-depicker) wrote :

Same state as @nik-weter above.

Changed in grub2 (Ubuntu):
status: Triaged → Confirmed
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.