19

Apt is seemingly unable to do anything useful for me, repeatedly giving messages of this form:

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

This is basically the same problem as I cannot install any package (linux-image-server, linux-server dependencies errors) which got closed Duplicate to an answer that is totally useless for this situation. None of the advice in that very generic answer about dependencies helps.

Explicitly:

sudo apt-get clean
sudo apt-get autoclean
sudo apt-get update

all have no not effect. While

sudo apt-get -f install
sudo dpkg --configure -a
sudo apt-get -u dist-upgrade
sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade

all give some form of the error message above.

0

3 Answers 3

21

You ran sudo apt-get update, and the problem still happens. So you probably just have a newer version of linux-image-server and linux-headers-server than any linux-server package available from your configured software sources.

This could occur for a very short time even if you're using the central server (or for a longer time if there were a problem updating it). My understanding is that it can occur for longer periods of time if you use a mirror. That doesn't mean you shouldn't use a mirror--the central server (http://archive.ubuntu.com) is usually very slow, and national, regional, or other mirrors are much faster.

A package search reveals that version 3.2.0.37.45 of both linux-image-server and linux-server exist for Ubuntu 12.04. So it's probably related to your mirror.

Here are some alternatives:

Ignore It

If you're able to use the package manager for other purposes, for example, to install other packages, then you can just ignore this. When your mirror gets updated, you'll probably just get the package.

It's not a problem not to have the latest linux-server package, as it's a metapackage that doesn't provide any actual software. It exists only so it can list three packages as dependencies, ensuring they remain installed:

You already have the latest versions of linux-headers-server and linux-image-server. My guess is that this is a 64-bit system, which is why no message about linux-generic-pae was shown. It seems like everything is fine.

However:

  • If the problem is preventing updating and installing other packages from working (as opposed to just showing those messages whenever you do so but not interfering with it), then you should apply some other solution.
  • You may also wish to do so, if you just don't like seeing these messages all the time and want to get rid of them.
  • It's a little strange you're not getting this package, even if you use a mirror that lags a bit behind the main download server, because this package is also provided by http://security.ubuntu.com. That server should always been enabled in /etc/apt/sources.list. So I recommend checking to make sure that is enabled. You may want to back up sources.list before editing it (sudo cp /etc/apt/sources.list /etc/apt/sources.list.old). The problem could also be a consequence of a caching web proxy (if you use one) with stale data. (The solutions below will work around that, too.)

Change to a Different Download Server

I'd guess you're running an Ubuntu Server system and probably don't have a GUI installed. So, see:

After changing your mirror, run:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

If you like, you can change your server back after linux-server is updated.

Manually Download and Install the .deb Package File

You can manually download and install the .deb file for the latest version of the linux-server metapackage in Ubuntu 12.04.

cd to wherever you want to download the package.

If this is a 64-bit system, run:

wget https://launchpad.net/ubuntu/+archive/primary/+files/linux-server_3.2.0.23.25_amd64.deb

If this is a 32-bit system, run this instead:

wget https://launchpad.net/ubuntu/+archive/primary/+files/linux-server_3.2.0.23.25_i386.deb

(I obtained both those links on the Launchpad page for the linux-meta source package in Ubuntu.)

Now (for both 64-bit and 32-bit), run this command to install the package:

sudo dpkg -i linux-server_3.2.0.23.25_*.deb

(Or just start typing the package's name and use Tab to complete it.)

Remove the Package

Since it's a metapackage providing software you already have, you can remove the package. Then you won't get the error anymore. You can install it again later if you like (you could periodically run apt-get update && apt-cache policy linux-server to see if the new version is available).

There are two steps, if you want to remove it. The first is to uninstall linux-server. the second is to make sure the packages won't be automatically removed later.

The dependencies will not be removed immediately. So it doesn't matter which of these steps you do first.

1. Uninstall linux-server.

To uninstall linux-server, just run:

sudo apt-get remove linux-server

2. Mark Its Dependencies as Manually Installed

To tell APT (the package manager) about packages that you intend to have installed even if nothing remains that declares them a dependency, mark them as manually installed.

To do that, run this command, if this is a 64-bit system:

sudo apt-mark manual linux-image-server linux-headers-server

If it's a 32-bit system, run this instead:

sudo apt-mark manual linux-image-server linux-headers-server linux-generic-pae

(You should have apt-mark but if you don't and you cannot install software, you can use apt-get install instead of apt-mark manual--specifying a package manually for installation causes it to be marked as manually installed even if if was already installed.)

Source: Mark a deb package as used, so it's not suggested for autoremoval
(In particular, Lekensteyn's answer.)

2
  • 3
    Thanks for the detailed response. Changing mirrors didn't change the situation at all. But manually installing the newer version of linux-server (linux-server_3.2.0.37.45) did fix the problem.
    – Leopd
    Feb 12, 2013 at 1:10
  • 2
    In my case, I couldn't use apt-get for anything. I always received the unmet dependency error for linux-server. Inspired by your advice, I tried the following, which worked and was much simpler: sudo apt-get remove linux-server && sudo apt-get install linux-server Mar 26, 2015 at 1:18
4

If you had a full /boot and automatic security upgrade installs broke apt, you may be in the same boat as I was.

I couldn't get apt-get to do anything so traditional full /boot advice didn't work. I manually removed old kernel data. Don't remove current running kernel, check with 'uname -a'. I removed with 'sudo rm /boot/-3.2.0-{23,24,25,26}-.

Then I had to run 'sudo apt-get remove linux-server' and 'sudo apt-get install linux-server' to correct the mess from the 1/2 installed kernel issue. After all that, I could finally 'sudo apt-get upgrade' and get things moving again.

For good measure, I tossed in a 'sudo update-grub' and 'sudo apt-get autoremove' to make sure the boot menu was accurate and other packages were cleaned up.

1
0

In the situation with Ubuntu 12.04, it was necessary to both manually install linux-headers-server and linux-server (as suggested above - I'd have commented there but don't have that privilege yet), and then apt-get remove linux-headers-virtual, which no longer seems to exist as a 64-bit package for 12.04.

sudo wget https://launchpad.net/ubuntu/+archive/primary/+files/linux-headers-server_3.2.0.64.76_amd64.deb

You must log in to answer this question.

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