无法安装某些软件包。依赖:x,但需要安装 x

无法安装某些软件包。依赖:x,但需要安装 x

我使用的是 64 位系统,我怀疑这就是造成此问题的原因。我尝试安装各种软件包,其中之一是libssl-dev

$ sudo 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.1f-1ubuntu2) but 1.0.1f-1ubuntu2.8 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.

我尝试sudo apt-get -f install按照网站上类似问题中的建议操作。但我得到的结果是:

$ sudo apt-get -f install 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

我在网站上进行了更多研究,有人建议手动安装缺少的软件包。所以我做了同样的事情:

$ sudo apt-get install libssl1.0.0 Reading package lists... Done
Building dependency tree       
Reading state information... Done
libssl1.0.0 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded

在这里您可以看到,该包已经安装。

所以我的猜测是我的系统正在尝试安装 64 位版本,libssl-dev但找不到 64 位版本libssl1.0.0。如果手动安装,我的系统显示我拥有的libssl1.0.0是 32 位版本,怀疑是 32 位版本。

我要安装的软件包还有很多都感染了这个错误。


以下是请求的输出@nephente

 $ uname -a
Linux sntsh-pc 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
 $ apt-cache policy libssl1.0.0 libssl-dev
libssl1.0.0:
  Installed: 1.0.1f-1ubuntu2.8
  Candidate: 1.0.1f-1ubuntu2.8
  Version table:
 *** 1.0.1f-1ubuntu2.8 0
        100 /var/lib/dpkg/status
     1.0.1f-1ubuntu2 0
        500 http://in.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://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
 $ 

答案1

强制降级libssl1.0.0

sudo apt-get install libssl1.0.0=1.0.1f-1ubuntu2

已安装的版本1.0.1f-1ubuntu2.8阻止安装libssl-dev


你应该立即更新你的机器。当前版本是1.0.1f-1ubuntu2.15

打开Software & Updatestrusty-security标记trusty-updates

在此处输入图片描述

在那之后

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

和不,sudo apt-get dist-upgrade 没有安装 Vivid。

相关内容