apt-get dependency issue when installing nginx passenger module

poc asked:

Sorry I Have no idea how to fix the dependency problem.

My Ubuntu server is 12.04 64 bit

$ sudo apt-get install libcurl4-openssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libcurl4-openssl-dev : Depends: libcurl3 (= 7.19.7-1ubuntu1.5) but 7.22.0-3ubuntu4.2 is to be installed
                        Depends: libidn11-dev but it is not going to be installed
                        Depends: libldap2-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

My answer:

This looks like a system that was only partly upgraded from 10.04 to 12.04. To resolve the problem you will need to complete the upgrade.

  1. Edit /etc/apt/sources.list and replace all occurrences of lucid with precise.

  2. Edit all files in the /etc/apt/sources.list.d directory and apply the same replacement as above.

    If any of the above files have an Ubuntu code name other than precise, change them to precise as well.

  3. Edit /etc/apt/preferences and remove any pinning which you may have done.

  4. Finish the upgrade:

    sudo apt-get update && sudo apt-get dist-upgrade
  5. Restart the computer.

Now try installing your software again.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.