问题:
# apt-get install libssl-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:
libssl-dev : Depends: libssl1.0.0 (= 1.0.1t-1+deb8u6) but 1.0.2k-1~bpo8+1 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.
这个调查:
# apt-cache policy libssl-dev
libssl-dev:
Installed: (none)
Candidate: 1.0.1t-1+deb8u6
Version table:
1.0.2k-1~bpo8+1 0
400 http://httpredir.debian.org/debian/ jessie-backports/main amd64 Packages
1.0.1t-1+deb8u6 0
900 http://security.debian.org/ jessie/updates/main amd64 Packages
1.0.1t-1+deb8u5 0
900 http://httpredir.debian.org/debian/ jessie/main amd64 Packages
100 <= P < 500导致安装版本,除非有属于其他发行版的可用版本或安装的版本更新
500 <= P < 990导致安装版本,除非有属于目标版本的可用版本或安装的版本更新
细节:
# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 8.7 (jessie)
Release: 8.7
Codename: jessie
# cat /etc/apt/preferences
Package: *
Pin: release a=stable
Pin-Priority: 900
Package: *
Pin: release a=jessie-backports
Pin-Priority: 400
看来我的优先级固定正确,尽管apt-get
正在尝试从jessie-backorts
.为什么?
编辑
# apt-cache policy libssl1.0.0
libssl1.0.0:
Installed: 1.0.2k-1~bpo8+1
Candidate: 1.0.2k-1~bpo8+1
Version table:
*** 1.0.2k-1~bpo8+1 0
100 /var/lib/dpkg/status
1.0.1t-1+deb8u6 0
990 http://security.debian.org/ jessie/updates/main amd64 Packages
1.0.1t-1+deb8u5 0
990 http://httpredir.debian.org/debian/ jessie/main amd64 Packages
我想我现在明白问题所在了。
答案1
您不应该固定向后移植套件;默认情况下,它被配置为仅用于具有明确目标的安装,或用于向后移植版本的升级。我建议您/etc/apt/preferences
完全删除您的文件。
无论如何,您的错误与固定无关,而是由libssl1.0.0
向后移植的安装版本引起的。请注意 : 给出的候选版本,apt-cache policy libssl-dev
表明apt-get
更喜欢稳定版本,而不是向后移植的版本。您收到的错误消息是
The following packages have unmet dependencies:
libssl-dev : Depends: libssl1.0.0 (= 1.0.1t-1+deb8u6) but 1.0.2k-1~bpo8+1 is to be installed
Recommends: libssl-doc but it is not going to be installed
这表明apt-get
正在尝试安装libssl-dev
1.0.1t-1+deb8u6 (因此依赖于libssl1.0.0
相同版本),但正在考虑的版本libssl1.0.0
是 1.0.2k-1~bpo8+1,因为这是已经安装的版本...