update-initramfs failed on upgrade

917 views
Skip to first unread message

Michael Pope

unread,
Nov 13, 2012, 7:35:54 PM11/13/12
to mlu...@googlegroups.com
I'm trying to update an Ubuntu 10.04 machine to 12.04 and I have ended
up with a computer which will boot but nothing displays on the screen.
After accessing the machine through ssh and doing a 'dpkg --configure
-a' to see why the 'do-release-upgrade' command failed to complete I
found that a few packages had errors. I started installing those and
they all installed except initramfs-tools.

Here is what happens when I try to install initramfs-tools:

sudo aptitude install initramfs-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following partially installed packages will be configured:
linux-image linux-image-3.2.0-33-generic linux-image-generic
0 packages upgraded, 0 newly installed, 0 to remove and 1710 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Setting up linux-image-3.2.0-33-generic (3.2.0-33.52) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.2.0-33-generic
Running postinst hook script /usr/sbin/update-grub.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-33-generic
Found memtest86+ image: /boot/memtest86+.bin
done
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools
3.2.0-33-generic /boot/vmlinuz-3.2.0-33-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-33-generic
E: /usr/share/initramfs-tools/hooks/casper failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.2.0-33-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at
/var/lib/dpkg/info/linux-image-3.2.0-33-generic.postinst line 1010.
dpkg: error processing linux-image-3.2.0-33-generic (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-image-3.2.0-33-generic; however:
Package linux-image-3.2.0-33-generic is not configured yet.
dpkg: error processing linux-image-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image:
linux-image depends on linux-image-generic (= 3.2.0.33.36); however:
Package linux-image-generic is not configured yet.
dpkg: error processing linux-image (--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.
Errors were encountered while processing:
linux-image-3.2.0-33-generic
linux-image-generic
linux-image
localepurge: Disk space freed in /usr/share/locale: 0 KiB
localepurge: Disk space freed in /usr/share/man: 0 KiB
localepurge: Disk space freed in /usr/share/gnome/help: 0 KiB
localepurge: Disk space freed in /usr/share/omf: 0 KiB
localepurge: Disk space freed in /usr/share/doc/kde/HTML: 0 KiB

Total disk space freed by localepurge: 0 KiB

E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up linux-image-3.2.0-33-generic (3.2.0-33.52) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.2.0-33-generic
Running postinst hook script /usr/sbin/update-grub.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-33-generic

Found memtest86+ image: /boot/memtest86+.bin
done
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools
3.2.0-33-generic /boot/vmlinuz-3.2.0-33-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-33-generic
E: /usr/share/initramfs-tools/hooks/casper failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.2.0-33-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at
/var/lib/dpkg/info/linux-image-3.2.0-33-generic.postinst line 1010.
dpkg: error processing linux-image-3.2.0-33-generic (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-image-3.2.0-33-generic; however:
Package linux-image-3.2.0-33-generic is not configured yet.
dpkg: error processing linux-image-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image:
linux-image depends on linux-image-generic (= 3.2.0.33.36); however:
Package linux-image-generic is not configured yet.
dpkg: error processing linux-image (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-3.2.0-33-generic
linux-image-generic
linux-image
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done

You have new mail.

Here is what I've tried on this 'test rig', none of which helped.
Remove all kernels
: sudo aptitude purge linux-image-2.6.32-44-generic
linux-image-2.6.32-41-generic linux-image-2.6.32-34-generic
linux-image-2.6.32-31-generic linux-image-2.6.32-29-generic
linux-image-2.6.32-28-generic linux-image-2.6.32-27-generic
linux-image-2.6.32-25-generic linux-image-2.6.32-24-generic

Try Remove nvidia driver (no change)
: sudo aptitude purge nvidia-173
: sudo aptitude purge nvidia-common

Try Removing dkms (no change)
: sudo aptitude purge dkms

Remove ksplice-uptrack (no change)
: sudo aptitude purge ksplice-uptrack

Install the latest kernel
: sudo apt-get install linux-image

Clean
: apt-get clean
: apt-get autoremove

After each of these I tried to install initramfs-tools with no luck
: sudo aptitude install initramfs-tools


I've started to have a look at line 1010 of
/var/lib/dpkg/info/linux-image-3.2.0-33-generic.postinst
It shows a system call on that line:
if (-d "/etc/kernel/postinst.d") {
print STDERR "Examining /etc/kernel/postinst.d.\n";
system ("run-parts --verbose --exit-on-error --arg=$version " .
"--arg=$realimageloc$kimage-$version " .
"/etc/kernel/postinst.d") &&
die "Failed to process /etc/kernel/postinst.d";
}



from
Michael

Darren Wurf

unread,
Nov 13, 2012, 9:50:45 PM11/13/12
to mlu...@googlegroups.com
On Wed, Nov 14, 2012 at 11:35 AM, Michael Pope
<ma...@corsairsolutions.com.au> wrote:
> I'm trying to update an Ubuntu 10.04 machine to 12.04 and I have ended up
> with a computer which will boot but nothing displays on the screen. After
> accessing the machine through ssh and doing a 'dpkg --configure -a' to see
> why the 'do-release-upgrade' command failed to complete I found that a few
> packages had errors. I started installing those and they all installed
> except initramfs-tools.
>

#snip#

Funny, this sounds similar to what happened to me last night (11.04 ->
11.10, boot process hanging).

Try this:

sudo apt-get -f install

Also, check your sources.list and make sure the mirror you're using is
still updating their 10.04 repo. I've been in situations before where
my Ubuntu was no longer supported and I had to hunt down a mirror
which had a copy of the latest files to finish my upgrade. 10.04 is
still supported but the mirror might have decided to deprecate it
anyway.

Cheers,

Darren

Michael Pope

unread,
Nov 20, 2012, 7:23:31 PM11/20/12
to mlu...@googlegroups.com

On 14/11/12 13:50, Darren Wurf wrote:
> On Wed, Nov 14, 2012 at 11:35 AM, Michael Pope
> <ma...@corsairsolutions.com.au> wrote:
>> I'm trying to update an Ubuntu 10.04 machine to 12.04 and I have ended up
>> with a computer which will boot but nothing displays on the screen. After
>> accessing the machine through ssh and doing a 'dpkg --configure -a' to see
>> why the 'do-release-upgrade' command failed to complete I found that a few
>> packages had errors. I started installing those and they all installed
>> except initramfs-tools.
> Try this:
>
> sudo apt-get -f install

Darren,

I just tried to force an install of initramfs-tools and I still get an
error:

sudo apt-get install -f initramfs-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
initramfs-tools is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 1712 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up initramfs-tools (0.99ubuntu13) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.32-44-generic
E: /usr/share/initramfs-tools/hooks/casper failed with return 1.
update-initramfs: failed for /boot/initrd.img-2.6.32-44-generic with 1.
dpkg: error processing initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
initramfs-tools
localepurge: Disk space freed in /usr/share/locale: 0 KiB
localepurge: Disk space freed in /usr/share/man: 0 KiB
localepurge: Disk space freed in /usr/share/gnome/help: 0 KiB
localepurge: Disk space freed in /usr/share/omf: 0 KiB
localepurge: Disk space freed in /usr/share/doc/kde/HTML: 0 KiB

Total disk space freed by localepurge: 0 KiB

E: Sub-process /usr/bin/dpkg returned an error code (1)

Here is what I get when doing a dpkg configure command:

sudo dpkg --configure -a
Setting up initramfs-tools (0.99ubuntu13) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.32-44-generic
E: /usr/share/initramfs-tools/hooks/casper failed with return 1.
update-initramfs: failed for /boot/initrd.img-2.6.32-44-generic with 1.
dpkg: error processing initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
initramfs-tools

I've changed the sources on this attempt to use 'deb
http://au.archive.ubuntu.com/ubuntu/ precise ...' instead of iinet just
incase there is a problem there.

from
Michael

Michael Pope

unread,
Nov 22, 2012, 5:43:52 PM11/22/12
to mlu...@googlegroups.com

> sudo dpkg --configure -a
> Setting up initramfs-tools (0.99ubuntu13) ...
> update-initramfs: deferring update (trigger activated)
> Processing triggers for initramfs-tools ...
> update-initramfs: Generating /boot/initrd.img-2.6.32-44-generic
> E: /usr/share/initramfs-tools/hooks/casper failed with return 1.
> update-initramfs: failed for /boot/initrd.img-2.6.32-44-generic with 1.
> dpkg: error processing initramfs-tools (--configure):
> subprocess installed post-installation script returned error exit
> status 1
> Errors were encountered while processing:
> initramfs-tools
>

Found that I had casper installed which is for live cds. I don't know
why this was hanging around. All I had to do is uninstall that and I
could update my initramfs. Here are my notes:

: sudo update-initramfs -uv
E: /usr/share/initramfs-tools/hooks/casper failed with return 1.
Removing /boot/initrd.img-2.6.32-44-generic.dpkg-bak
update-initramfs: failed for /boot/initrd.img-2.6.32-44-generic with 1.

Ref https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/975413
This error is to do with a package which is used for live cds and
shouldn't be on the system. Uninstall it like so
: sudo apt-get remove casper ubiquity-casper

Now try an update again
: sudo update-initramfs -uv

from
Michael
Reply all
Reply to author
Forward
0 new messages