6

I try sudo apt-get install libpq-dev and I got this error

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:
 libpq-dev : Depends: libssl-dev but it is not going to be installed
             Depends: krb5-multidev but it is not going to be installed
             Depends: comerr-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I also run this command apt-cache policy libpq-dev libssl-dev krb5-multidev comerr-dev and this is the result

libpq-dev:
  Installed: (none)
  Candidate: 9.3.4-1
  Version table:
     9.3.4-1 0
    500 http://sd.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
libssl-dev:
  Installed: (none)
  Candidate: 1.0.1f-1ubuntu2
  Version table:
     1.0.1f-1ubuntu2 0
        500 http://sd.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
krb5-multidev:
  Installed: (none)
  Candidate: 1.12+dfsg-2ubuntu4
  Version table:
     1.12+dfsg-2ubuntu4 0
        500 http://sd.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
comerr-dev:
  Installed: (none)
  Candidate: 2.1-1.42.9-3ubuntu1
  Version table:
     2.1-1.42.9-3ubuntu1 0
        500 http://sd.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

output of sudo apt-get install libssl-dev krb5-multidev comerr-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:
 comerr-dev : Depends: libcomerr2 (= 1.42.9-3ubuntu1) but 1.42.9-3ubuntu1.2 is to be installed
 krb5-multidev : Depends: libkrb5-3 (= 1.12+dfsg-2ubuntu4) but 1.12+dfsg-2ubuntu5.1 is to be installed
                 Depends: libk5crypto3 (= 1.12+dfsg-2ubuntu4) but 1.12+dfsg-2ubuntu5.1 is to be installed
                 Depends: libgssapi-krb5-2 (= 1.12+dfsg-2ubuntu4) but 1.12+dfsg-2ubuntu5.1 is to be installed
 libssl-dev : Depends: libssl1.0.0 (= 1.0.1f-1ubuntu2) but 1.0.1f-1ubuntu2.15 is to be installed
              Recommends: libssl-doc but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

what i can do to fix this?

4
  • The output of sudo apt-get update; sudo apt-get dist-upgrade; sudo apt-get install -f and the output of apt-cache policy libssl1.0.0 libkrb5-3 libk5crypto3 libgssapi-krb5-2 libcomerr2
    – A.B.
    Dec 25, 2015 at 19:44
  • Use paste.ubuntu.com for the output and give us the link.
    – A.B.
    Dec 25, 2015 at 19:44
  • @A.B. paste.ubuntu.com/14208587 this is the second command . the first command doesn't finish it stuck at some point Dec 25, 2015 at 19:58
  • Let us continue this discussion in chat.
    – A.B.
    Dec 25, 2015 at 20:02

2 Answers 2

4

Your sources are very outdated, ex. of current versions,

libpq-dev - 9.3.10-0ubuntu0.14.04

libssl-dev - 1.0.1f-1ubuntu2.16

krb5-multidev - 1.12+dfsg-2ubuntu5.2

comerr-dev - 2.1-1.42.9-3ubuntu1.3

Open Software & Updates, make sure that both trusty-security & trusty-updates are enabled under the Updates tab, then reload your sources & see if you get the current versions. If both were already enabled then open a terminal & run sudo apt-get update, then check for current versions.

If that doesn't help then again open Software & Updates & on main page switch to a different mirror in the Download from: section, reload sources, ect.

1
  • I have tried many options given in many threads, finally this fixed my issue.
    – user132929
    Sep 4, 2017 at 12:30
2

As I can see here and in your question, you have some (manually?) installed packages which conflict with the packages in the Ubuntu standard repositories. The packages that you want to install, need exactly the required versions of the dependencies.

Run the commands below:

sudo apt-get update
sudo apt-get install libssl1.0.0=1.0.1f-1ubuntu2 ibcomerr2=1.42.9-3ubuntu1

to downgrade each of them.

For the other packages you have to enable trusty-security and trusty-updates (with a little script taken from here). This packages contains a higher version than the installed version.

sudo apt-get install git
git clone https://github.com/kos0/addRemoveDistribution.git
cd addRemoveDistribution
sudo ./enableDisableDistribution.pl enable security
sudo ./enableDisableDistribution.pl enable updates

After that

sudo apt-get update
sudo apt-get install libpq-dev
7

You must log in to answer this question.

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