This question already has an answer here:

dpkg --configure -a

Setting up linux-image-3.13.0-35-generic (3.13.0-35.62) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.13.0-35-generic
vmlinuz(/boot/vmlinuz-3.13.0-35-generic
) points to /boot/vmlinuz-3.13.0-35-generic
 (/boot/vmlinuz-3.13.0-35-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-3.13.0-35-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-35-generic /boot/vmlinuz-3.13.0-35-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-35-generic /boot/vmlinuz-3.13.0-35-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-35-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.13.0-35-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.13.0-35-generic.postinst line 1025.
dpkg: error processing package linux-image-3.13.0-35-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-3.13.0-35-generic:
 linux-image-extra-3.13.0-35-generic depends on linux-image-3.13.0-35-generic; however:
  Package linux-image-3.13.0-35-generic is not configured yet.

dpkg: error processing package linux-image-extra-3.13.0-35-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.13.0-35-generic; however:
  Package linux-image-3.13.0-35-generic is not configured yet.
 linux-image-generic depends on linux-image-extra-3.13.0-35-generic; however:
  Package linux-image-extra-3.13.0-35-generic is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-3.13.0-35-generic
 linux-image-extra-3.13.0-35-generic
 linux-image-generic

marked as duplicate by N0rbert, Charles Green, Melebius, Eric Carvalho, earthmeLon Oct 6 at 3:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

I had this issue just now. What I did was purge the errant package using dpkg in my case then update and force the reinstall:

sudo dpkg --purge linux-image-3.13.0-35-generic
sudo apt-get update
sudo apt-get -f install

The installation process may take a bit longer, but it worked in the end.

  • I had the same thing on mine, my host machine ran out of space and prevented the VM from updating even when I gave it more space after. The steps I outlined above fixed it. – Archimedes Trajano Aug 30 '14 at 5:35
  • did not work for me – Wolfgang Fahl Jan 3 '16 at 13:47
  • 4
    dpkg: error processing package linux-image-4.4.0-53-generic (--purge): dependency problems - not removing – Aaron Franke Dec 13 '16 at 5:10
  • 1
    Purge does not work. Terminal output: linux-image-generic depends on linux-image-4.4.0-78-generic – Jossi Jun 1 '17 at 9:45

Your problem is:

update-initramfs: Generating /boot/initrd.img-3.16.0-43-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1

Solution:

apt-get autoremove
  • 1
    I'm in a similar situation but each time I run autoremove, apt-get says it wants me to finish previous linux kernel install with -f install first. – Qi Fan Apr 25 '17 at 18:07

For me the solution was different.

I used the command sudo aptitude, when the graphical menu appeared I used / to get a pop-up search field and find all the linux-header, linux-image, linux-server versions and removed all but the one currently not used by pressing -.

To find the current kernel version I used uname -r.

Finally I installed a newer version of linux-{header, image, server} in the order specified by selecting them and pressing +.

To confirm the updates I used u.

At the end I rebooted and everything was fixed.

  • 1
    After a real mess this was the only solution that helped me to get rid of the troubling package. Thanks so much! – GameScripting Dec 5 '17 at 15:50
  • Worked for me. Kept linux---4.4.0-133-generic, deleted all linux-header, linux-image, linux-server with other version numbers. Now my 7 year old laptop works like a charm again. – Martien Lubberink Sep 2 at 3:15

For me the solution was to reinstall the conflicting package (if it doesn't require any uninstalled dependencies) using Synaptic Package Manager. Everything else failed, only Synaptic did the job. Hope this helps.

Not the answer you're looking for? Browse other questions tagged or ask your own question.