我正在尝试安装 libpq-dev,但在尝试执行此操作时收到错误。
当我跑步时:
sudo apt-get install libpq-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:
libpq-dev : Depends: libpq5 (= 9.5.5-0ubuntu0.16.04) but 9.6.0-1 is to be installed
Depends: krb5-multidev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
当我跑步时apt-cache policy libpq5
:
libpq5:
Installed: 9.6.0-1
Candidate: 9.6.0-1
Version table:
*** 9.6.0-1 100
100 /var/lib/dpkg/status
9.5.5-0ubuntu0.16.04 500
500 http://il.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
9.5.4-0ubuntu0.16.04 500
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
9.5.2-1 500
500 http://il.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
我该如何解决这个问题?
答案1
看起来libpq-dev
软件包需要libpq5
9.5.5-0
版本,而您有9.6.0-1
版本。您必须强制降级libpq5
软件包:
sudo apt-get install libpq5=9.5.5-0ubuntu0.16.04
接下来是krb5-multidev
安装:
sudo apt-get install krb5-multidev
更新
我不知道为什么会发生这种情况,但是如果你从终端下载这两个版本,libkrb5-3
默认libgssapi-krb5-2
情况下它会安装该1.13.2+dfsg-5
版本。应用以前的方法来解决此问题:
sudo apt-get install libgssapi-krb5-2=1.13.2+dfsg-5
sudo apt-get install libkrb5-3=1.13.2+dfsg-5