Unmet dependencies: not configured yet

linux-image-server depends on linux-image-3.2.0-39-generic; however:
  Package linux-image-3.2.0-39-generic is not installed.
dpkg: error processing linux-image-server (--configure):
  dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of linux-server:
linux-server depends on linux-image-server (= 3.2.0.39.47); however:
  Package linux-image-server is not configured yet.
linux-server depends on linux-headers-server (= 3.2.0.39.47); however:
  Version of linux-headers-server on system is 3.2.0.40.48.
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.

Errors were encountered while processing:

linux-image-server
linux-server

E: Sub-process /usr/bin/dpkg returned an error code (1)

I don't know how to fix this issue. Plz help me. ><


Solution 1:

This worked for me:

sudo dpkg --remove linux-server
sudo dpkg --remove linux-image-server linux-headers-server
# purge unused kernels, but could do more so your mileage may vary
sudo apt-get autoremove
sudo apt-get install linux-server linux-image-generic linux-headers-generic

Solution 2:

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 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.