41

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
1

4 Answers 4

49

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.

4
  • 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. Aug 30, 2014 at 5:35
  • did not work for me Jan 3, 2016 at 13:47
  • 8
    dpkg: error processing package linux-image-4.4.0-53-generic (--purge): dependency problems - not removing Dec 13, 2016 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, 2017 at 9:45
22

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
2
  • 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, 2017 at 18:07
  • 1
    I had to run sudo apt --fix-broken install before running sudo apt autoremove to fix this issue.
    – miceagol
    Mar 15, 2021 at 13:03
3

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.

2
  • 1
    After a real mess this was the only solution that helped me to get rid of the troubling package. Thanks so much! Dec 5, 2017 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. Sep 2, 2018 at 3:15
0

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 .