6

I have seen some similar questions but none that I have seen have resolved my issue. An error occured durring a kernel upgrade on Ubuntu 12.04 from linux-image-3.2.0-36-generic to linux-image-3.2.0-38-generic. A Kernel Panic occurs on boot while booting with 3.2.0-38.

Booting in under `3.2.0-36 the system starts normally. However when I attempt to remove clean or configure the affected kernel package it throws the following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
initramfs-tools : Depends: initramfs-tools-bin (< 0.99ubuntu13.1~) but 0.99ubuntu13.1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Attempting sudo apt-get -f install, meets with no success citing dependency and configuration issues, after the package retrevial:

dpkg: dependency problems prevent configuration of initramfs-tools:
 initramfs-tools depends on initramfs-tools-bin (<< 0.99ubuntu13.1~); however:
  Version of initramfs-tools-bin on system is 0.99ubuntu13.1.
dpkg: error processing initramfs-tools (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-3.2.0-38-generic:
 linux-image-3.2.0-38-generic depends on initramfs-tools (>= 0.36ubuntu6); however:
  Package initramfs-tools is not configured yet.
dpkg: error processing linux-image-3.2.0-38-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error    from a previous failure.
                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                    dpkg: dependency problems prevent configuration of casper:
 casper depends on initramfs-tools (>= 0.92bubuntu55); however:
  Package initramfs-tools is not configured yet.
dpkg: error processing casper (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 initramfs-tools
 linux-image-3.2.0-38-generic
 casper
E: Sub-process /usr/bin/dpkg returned an error code (1)

I receive similar errors when running dpkg -- configure -a, apt-get -f dist-upgrade and apt-get -f autoremove.

Any ideas on what exactly corrupted during the kernel upgrade and how I can roll back my kernel version without using Apt-get or Dpkg?

3 Answers3

6

The procedure is recover from this problem is to temporarly remove all problematic packages with:

 dpkg --force-depends --purge <packages> 

Afterwards repair the missing dependencies with

apt-get install -f

Ensure that your system is running not on the 3.2.0-38 kernel with

uname -r 

Then I suggest to do a:

dpkg --force-depends --purge linux*3.2.0-38*
apt-get install -f
2

The packages causing all this trouble are initramfs-tools and initramfs-tools-bin. Their versions are 0.99ubuntu13 in precise repository and 0.99ubuntu13.1 in precise-updates repository. Somehow the package lists are in a inconsistent state making apt trying to install one version from each repository.

Remove the package lists:

sudo rm /var/cache/apt/*.bin /var/lib/apt/lists/* /var/lib/apt/lists/partial/*

Then run apt-get update to download new package lists, then try apt-get -f install again.

Eric Carvalho
  • 54,385
  • It seems to be hanging a bit on: Found memtest86+ image: /boot/memtest86+.bin. How long is it supposed to stay on that message? – Simianspaceman Mar 05 '13 at 18:20
  • It shold be fast. What's the output of apt-get -f install? – Eric Carvalho Mar 05 '13 at 19:43
  • it would hang at at all messages that contained boot/memtest86+.bin. In this case it was solved by repeated purging and updating. But removing the lists directory seemed to help. It was ultimately a mix of the two methods. – Simianspaceman Mar 15 '13 at 21:46
0

This helped me in solving the issue:

sudo apt-get remove grub*

followed by

sudo apt-get update && sudo apt-get upgrade

Hope this helps you too.

Automatic translation from the original answer in Spanish.