50
administrator@zlounes:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 linux-server : Depends: linux-headers-server (= 3.2.0.37.44) but 3.2.0.37.45 is installed
E: Unmet dependencies. Try using -f.
administrator@zlounes:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  linux-image-server linux-server
The following packages will be upgraded:
  linux-image-server linux-server
2 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
4 not fully installed or removed.
Need to get 0 B/4,458 B of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Traceback (most recent call last):
  File "/usr/bin/apt-listchanges", line 237, in <module>
    main()
  File "/usr/bin/apt-listchanges", line 48, in main
    debs = apt_listchanges.read_apt_pipeline(config)
  File "/usr/share/apt-listchanges/apt_listchanges.py", line 83, in read_apt_pipeline
    return map(lambda pkg: filenames[pkg], order)
  File "/usr/share/apt-listchanges/apt_listchanges.py", line 83, in <lambda>
    return map(lambda pkg: filenames[pkg], order)
KeyError: 'linux-image-server'
Setting up initramfs-tools (0.99ubuntu13.1) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-3.2.0-37-generic (3.2.0-37.58) ...
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-37-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-37-generic /boot/vmlinuz-3.2.0-37-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-37-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.2.0-37-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-37-generic.postinst line 1010.
dpkg: error processing linux-image-3.2.0-37-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-server:
 linux-image-server depends on linux-image-3.2.0-37-generic; however:
  Package linux-image-3.2.0-37-generic is not configured yet.
dpkg: error processing linux-image-server (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-server:
 linux-server depends on linux-image-server (= 3.2.0.37.44); however:
  Package linux-image-server is not configured yet.
 linux-server depends on linux-headers-server (= 3.2.0.37.44); however:
  Version of linux-headers-server on system is 3.2.0.37.45.
dpkg: error processing linux-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-36-generic
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.

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.2.0-36-generic with 1.
dpkg: error processing initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 linux-image-3.2.0-37-generic
 linux-image-server
 linux-server
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried a lot and can't get this working. I think I interrupted an install and it just screwed it all up. I've googled and tried various fixes.

EDIT (After cleaning my /boot folder) :

administrator@zlounes:/boot$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  linux-server
The following packages will be upgraded:
  linux-server
1 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1,734 B of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Traceback (most recent call last):
  File "/usr/bin/apt-listchanges", line 237, in <module>
    main()
  File "/usr/bin/apt-listchanges", line 48, in main
    debs = apt_listchanges.read_apt_pipeline(config)
  File "/usr/share/apt-listchanges/apt_listchanges.py", line 83, in read_apt_pipeline
    return map(lambda pkg: filenames[pkg], order)
  File "/usr/share/apt-listchanges/apt_listchanges.py", line 83, in <lambda>
    return map(lambda pkg: filenames[pkg], order)
KeyError: 'linux-server'
dpkg: dependency problems prevent configuration of linux-server:
 linux-server depends on linux-image-server (= 3.2.0.37.44); however:
  Version of linux-image-server on system is 3.2.0.37.45.
 linux-server depends on linux-headers-server (= 3.2.0.37.44); however:
  Version of linux-headers-server on system is 3.2.0.37.45.
dpkg: error processing linux-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          E: Sub-process /usr/bin/dpkg returned an error code (1)
administrator@zlounes:/boot$
6
  • 2
    why do you assume a problem with package dependencies when the error states gzip: stdout: No space left on device? It looks to me like the dependencies are NOT installed because you lack the space to install software.
    – Rinzwind
    Feb 8, 2013 at 15:29
  • Please add in the results of df. I guess your /boot partition is full.
    – Rinzwind
    Feb 8, 2013 at 15:31
  • Thank you :). I have cleaning my /boot folder but i've again the same error (i've edited my first post with code error), thank you in advance and sorry for my poor english
    – zlounes
    Feb 8, 2013 at 15:49
  • By "cleaning my boot folder", do you mean you deleted files in that folder? You probably won't like the results of doing that.
    – colboynik
    Feb 8, 2013 at 20:08
  • No it's good, i have selected file ;)
    – zlounes
    Feb 10, 2013 at 21:20

5 Answers 5

83

A good try to ensure that you system is in a good shape and not has problems with aborted installation is to invoke

  dpkg --configure -a 

Ensure that the package list are updated and no problem is shown on:

 apt-get update

Optional you can remove all old data before the update with:

 find /var/lib/apt/lists -type f  |xargs rm -f >/dev/null \

Next step to resolve the problem is to remove the linux-server package for a while. This can be done because it has no real content and only introduce a dependency:

This package will always depend on the latest complete Linux kernel available for Server Equipment.

 dpkg --remove linux-server

After this step check that all current dependencies are installed:

apt-get install -f

If everything is o.k. you can now install linux-server again:

apt-get install linux-server

Postscriptum

linux-server is deprecated in 12.04. Also for server equipment the generic kernel is used. See apt-cache show linux-image-server

Package: linux-image-server...

Section: metapackages

....

Depends: linux-image-3.2.0-23-generic, linux-firmware

2
  • Thank you very much. I thought I would be spending a day re-installing the server..
    – uncletall
    Mar 13, 2014 at 0:12
  • Nope. This "answer" does literally nothing at all. I have the same exact problem except the problem package is python3. Following these steps with python3 instead of linux-server did nothing but keep coughing up the original errors every step of the way, except the "optional" command, which only responded with >.
    – John Smith
    Nov 17, 2023 at 20:00
11

I am regularly having to clean out the /boot of my machines and usually being too full breaks the update - not sure what the ultimate solution is but the process I use seems to work:

Start off with a sudo su

Then go to /boot and do a ls -lSrh - the ones at the bottom are the biggest - rm enough of the older ones to clear up enough space.

Then try the following (as excerpted somewhat from above):

  1. sudo apt-get remove linux-server
  2. dpkg --configure -a
  3. apt-get update
  4. apt-get install -f
  5. apt-get autoremove
  6. dpkg --get-selections|grep 'linux-image*'|awk '{print $1}'|egrep -v "linux-image-$(uname -r)|linux-image-generic" |while read n;done
  7. apt-get install linux-image-server linux-server
  8. reboot

If anything fails, make a comment here and I will see what the issue might be.

I have seen this sort of thing work for the postgresql-9.1 package issues when using the pitti PPA as well.

One time when I ran the procedure I had a problem with grub. Doing a apt-get install --reinstall grub fixed it.

Thanks for the one liner goes to: http://ubuntuforums.org/showpost.php?p=12180959&postcount=7

Good luck!

1
  • Step 6 seems like it got cut off: dpkg --get-selections|grep 'linux-image*'|awk '{print $1}'|egrep -v "linux-image-$(uname -r)|linux-image-generic" |while read n;do apt-get -y remove $n;done
    – Tom Swifty
    Sep 30, 2014 at 15:07
1

I had a similar problem when using dpkg:

dpkg: dependency problems prevent configuration of rpi-imager:
 rpi-imager depends on qml-module-qtquick2; however:
 Package qml-module-qtquick2 is not installed.

Solution was to run sudo apt --fix-broken install

0

gzip: stdout: No space left on device

It seems you run out of space. Clear some space and fix the package issues by:

sudo apt-get purge
sudo apt-get clean
sudo apt-get check
sudo apt-get install -f
sudo dpkg --configure -a 

Then reinstall the packages again.

Source: Thread: Dpkg: Dependency problems - leaving unconfigured.

0

TL;DR Use dpkg --ignore-depends=...


I tried to install pulse-secure vpn client.

dpkg: regarding .../ps-pulse-ubuntu-debian.deb containing pulsesecure, pre-dependency problem:
 pulsesecure pre-depends on libcurl4
  libcurl4 is not installed.

dpkg: warning: ignoring pre-dependency problem!
(Reading database ... 208790 files and directories currently installed.)
Preparing to unpack .../ps-pulse-ubuntu-debian.deb ...

Solved with flag --ignore-depends=...

sudo dpkg --ignore-depends=libcurl4 -i /valo/pulse-secure-ubuntu-debian.deb

You must log in to answer this question.

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