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
cikasaso
  • 421

4 Answers4

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.

jokerdino
  • 41,320
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
jokerdino
  • 41,320
Ilja
  • 321
  • 2
  • 5
  • 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
  • 1
    I had to run sudo apt --fix-broken install before running sudo apt autoremove to fix this issue. – miceagol Mar 15 '21 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.

Stanislav
  • 223
  • 1
  • 9
  • 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 05 '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 02 '18 at 03: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.

KeyC0de
  • 811