1

This is a first for me. I've been having trouble upgrading Ubuntu 12.04. How do I fix this?

sudo apt-get upgrade:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up linux-image-3.8.0-42-generic (3.8.0-42.62~precise1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.8.0-42-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.8.0-42-generic /boot/vmlinuz-3.8.0-42-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.8.0-42-generic /boot/vmlinuz-3.8.0-42-generic
update-initramfs: Generating /boot/initrd.img-3.8.0-42-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.8.0-42-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.8.0-42-generic.postinst line 1010.
dpkg: error processing linux-image-3.8.0-42-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of linux-image-generic-lts-raring:
 linux-image-generic-lts-raring depends on linux-image-3.8.0-42-generic; however:
  Package linux-image-3.8.0-42-generic is not configured yet.
dpkg: error processing linux-image-generic-lts-raring (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of linux-generic-lts-raring:
 linux-generic-lts-raring depends on linux-image-generic-lts-raring; however:
  Package linux-image-generic-lts-raring is not configured yet.
dpkg: error processing linux-generic-lts-raring (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 linux-image-3.8.0-42-generic
 linux-image-generic-lts-raring
 linux-generic-lts-raring
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have over 2TB of space remaining on the hard drive. I don't understand:

  • gzip: stdout: No space left on device
  • MaxReports is reached already
4
  • 1
    Similar to what @Jobin is asking, what's the partition schema of your hard drive look like? Do you have everything all on one partition? Do you have some things on other partitions?
    – Mitch
    Jun 16, 2014 at 14:18
  • 1
    Please post the output of df -h Jun 16, 2014 at 14:31
  • 1
    Charles is right, post df -h output because could be you have a partition that's getting full (while having lot of space in the others). Jun 16, 2014 at 14:43
  • 1
    Thanks for the help guys. Your comments reminded me of the notes I had for this problem. The issue was indeed the boot partition being full. Jun 16, 2014 at 14:54

1 Answer 1

3

Ok, this was not a first for me, after all. I ran across some old notes I made last time this happened. Here's how I fixed it.

What percentage of the boot partition is used?

df -H | grep boot
/dev/sda2    240M  224M  3.5M  99% /boot

What kernel images are currently installed:

sudo dpkg --list | grep linux-image
ii  linux-image-3.8.0-29-generic         3.8.0-29.42~precise1                    Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-34-generic         3.8.0-34.49~precise1                    Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-35-generic         3.8.0-35.52~precise1                    Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-36-generic         3.8.0-36.52~precise1                    Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-37-generic         3.8.0-37.53~precise1                    Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-38-generic         3.8.0-38.56~precise1                    Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-39-generic         3.8.0-39.58~precise1                    Linux kernel image for version 3.8.0 on 64 bit x86 SMP
ii  linux-image-3.8.0-41-generic         3.8.0-41.60~precise1                    Linux kernel image for version 3.8.0 on 64 bit x86 SMP
iF  linux-image-3.8.0-42-generic         3.8.0-42.62~precise1                    Linux kernel image for version 3.8.0 on 64 bit x86 SMP
iU  linux-image-generic-lts-raring       3.8.0.42.42                             Generic Linux kernel image

Which kernel image is actually being used:

uname -a
Linux backup 3.8.0-41-generic #60~precise1-Ubuntu SMP Fri May 16 00:18:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linu

Remove each old kernel not being used:

sudo apt-get purge linux-image-3.8.0-29-generic linux-image-3.8.0-34-generic linux-image-3.8.0-35-generic linux-image-3.8.0-35-generic linux-image-3.8.0-35-generic linux-image-3.8.0-36-generic linux-image-3.8.0-37-generic linux-image-3.8.0-38-generic linux-image-3.8.0-39-generic

After this I was able to upgrade:

sudo apt-get upgrade
2
  • 2
    Why is sudo apt-get autoremove not enough? Oct 17, 2014 at 21:47
  • You're right. That's much easier. Jul 9, 2015 at 10:36

Not the answer you're looking for? Browse other questions tagged .