GRUB_PREFIX not set after dist-upgrade

Bug #1078653 reported by RüdiCoerdt
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
Invalid
Low
Unassigned

Bug Description

Dear team,

I need some help, as I'm lost finding relevant reports & help suggestions in launchpad. My Monday's (Nov 12, 2012) upgrade attempt finished, although with errors. I can use my system, but I cannot update/install/remove any packages. apport seems to crash every time I try to report errors.

grub-pc:
/var/log/dist-upgrade/main.log:2012-11-12 13:08:10,311 DEBUG running apport_pkgfailure() grub-pc: subprocess installed post-installation script returned error exit status 1
/var/log/dist-upgrade/main.log:2012-11-12 13:08:10,619 ERROR got an error from dpkg for pkg: 'grub-pc': 'subprocess installed post-installation script returned error exit status 1'

apport: unpack requires a byte object of length 4, no error report sent.

Software updater: Software index is broken: It is impossible to install or remove any software.

linux versions: e.g.
dpkg: error processing linux-image-3.2.0-31-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-3.2.0-29-generic
 linux-image-3.2.0-30-generic
 linux-image-3.2.0-31-generic

The last one stops me from doing anything to correct the errors by installing other/newer/better versions.

What do you need to identify the errors?
lsb_release -rd
Description: Ubuntu 12.10
Release: 12.10
---
ApportVersion: 2.6.1-0ubuntu10
Architecture: amd64
DistroRelease: Ubuntu 12.10
InstallationDate: Installed on 2011-12-02 (481 days ago)
InstallationMedia: Lubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
MarkForUpload: True
Package: ubuntu-release-upgrader (not installed)
ProcVersionSignature: Ubuntu 3.5.0-27.45-generic 3.5.7.7
Tags: quantal dist-upgrade
Uname: Linux 3.5.0-27-generic x86_64
UpgradeStatus: Upgraded to quantal on 2012-11-12 (135 days ago)
UserGroups:

VarLogDistupgradeTermlog:

Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote :

Looks like the problems removing older linux versions come from grub-pc errors; extract from /var/log/dist-upgrade/apt-term.log:

Removing linux-image-3.2.0-29-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-29-generic /boot/vmlinuz-3.2.0-29-generic
update-initramfs: Deleting /boot/initrd.img-3.2.0-29-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-29-generic /boot/vmlinuz-3.2.0-29-generic
Generating grub.cfg ...
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.2.0-29-generic.postrm line 328.
dpkg: error processing linux-image-3.2.0-29-generic (--remove):
 subprocess installed post-removal script returned error exit status 1

Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote :

I can't reinstall grub-pc as the removal of the old linux versions (29,30,31) cannot be unselected in synaptic. Catch 22!

Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote :

Obviously the old kernel files already have been deleted:
ls -la /boot
. . .
-rw------- 1 root root 2884076 Sep 27 00:14 System.map-3.2.0-32-generic
-rw------- 1 root root 2902868 Oct 19 12:50 System.map-3.5.0-18-generic
-rw------- 1 root root 4966768 Sep 27 00:14 vmlinuz-3.2.0-32-generic
-rw------- 1 root root 5132688 Oct 19 12:50 vmlinuz-3.5.0-18-generic

BTW - why does linux-3.5.0-18 show up here?

Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote :

Found the offending part: /etc/grub.d/05_debian_theme which exited with status 1 as it failed on
test -d "${GRUB_PREFIX}"; cd "${GRUB_PREFIX}"
and GRUB_PREFIX was not set.

As a band aid I cd'd to "/boot/grub" literally.

The distribution upgrade must have removed the definition of GRUB_PREFIX, whereever it may have been before.

Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote :

For me, this bug report is settled. Somebody still may want to publish a cure to the underlying problem/error.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Confirmed
Revision history for this message
Gary Richards (ashak) wrote :

I have a new precise install on which I have the exact same problem. The install works, as soon as I try to do an upgrade on a server that requires a kernel upgrade I see the above problem.

GRUB_PREFIX is not set wherever it's expected to be and this causes /etc/grub.d/05_debian_theme to fail when apt runs update-grub

tags: added: dist-upgrade precise precise2quantal
summary: - upgrade Ubuntu 12.04 -> 12.10 has several problems: grub-pc, apport,
- older linux versions
+ GRUB_PREFIX not set after dist-upgrade
Revision history for this message
Colin Watson (cjwatson) wrote :

This GRUB_PREFIX line is from an earlier version of grub-common; I removed it in 2.00-1. Therefore, this looks like you had modified /etc/grub.d/05_debian_theme locally, and either (a) you chose to keep your locally-modified version or (b) you weren't prompted for what to do and something defaulted to keeping the locally-modified version. Could you please attach /var/log/apt/term.log so that we can try to tell which of these happened?

Changed in ubuntu-release-upgrader (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Brian Murray (brian-murray) wrote :

The log file from the distribution upgrade may actually be located in /var/log/dist-upgrade/ and named apt-term.log. If you were to run 'apport-collect 1078653' in a terminal this will gather all the log files we may need. Thanks!

Changed in ubuntu-release-upgrader (Ubuntu):
importance: Undecided → Low
Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote : ProcEnviron.txt

apport information

tags: added: apport-collected quantal
description: updated
Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote : VarLogDistupgradeAptHistorylog.txt

apport information

Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote : VarLogDistupgradeAptclonesystemstate.tar.gz

apport information

Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote : VarLogDistupgradeAptlog.txt

apport information

Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote : VarLogDistupgradeApttermlog.gz

apport information

Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote : VarLogDistupgradeLspcitxt.txt

apport information

Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote : VarLogDistupgradeMainlog.txt

apport information

Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote :

@Colin Watson (cjwatson), post #8

Not sure if I understand you entirely, but I definitely didn't touch /etc/grub.d/05_debian_theme before that upgrade. Here's the fix that I applied on Dec 4, after weeks of fiddling:

#test -d "${GRUB_PREFIX}"; cd "${GRUB_PREFIX}"
cd /boot/grub

which made it work again, after all.

Revision history for this message
RüdiCoerdt (ruediger-coerdt) wrote :

I have to correct my comment above - I changed terminal colours in /etc/grub.d/05_debian_theme way before that upgrade.

Changed in ubuntu-release-upgrader (Ubuntu):
status: Incomplete → New
status: New → Confirmed
Revision history for this message
Brian Murray (brian-murray) wrote :

During the upgrade you were asked to either keep the version of 05_debian_theme you had modified or to install the new version, because you choose to keep the old version you did not receive the change that would have removed the GRUB_PREFIX line as Colin mentioned. In the future one thing to do would be choose "show the differences between the versions" to inspect the changes between the files and make a decision after that.

Here is the relevant bit of the upgrade log:

Configuration file `/etc/grub.d/05_debian_theme'^M
 ==> Modified (by you or by a script) since installation.^M
 ==> Package distributor has shipped an updated version.^M
   What would you like to do about it ? Your options are:^M
    Y or I : install the package maintainer's version^M
    N or O : keep your currently-installed version^M
      D : show the differences between the versions^M
      Z : start a shell to examine the situation^M
 The default action is to keep your current version.^M
*** 05_debian_theme (Y/I/N/O/D/Z) [default=N] ? n^M

Changed in ubuntu-release-upgrader (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers