libssl-dev版本问题无法安装 : Depends: libssl1.0.0 (= 1.0.1t-1+deb7u2) but 1.0.1t-1+deb8u6 is to be installed

问题现象:

在安装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.1t-1+deb7u2) but 1.0.1t-1+deb8u6 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.



解决方法:

linux的版本依赖问题很令人纠结,不过我们可以通过使用aptitude软件包管理器来解决这个依赖问题,aptitude是可以选择合适的版本与匹配软件安装。

首先安装aptitude工具

sudo apt-get install aptitude
再利用aptitude来安装libssl-dev

sudo aptitude install libssl-dev
The following NEW packages will be installed:
  libssl-dev{b} libssl-doc{a} 
0 packages upgraded, 2 newly installed, 0 to remove and 12 not upgraded.
Need to get 2,755 kB of archives. After unpacking 6,426 kB will be used.
The following packages have unmet dependencies:
 libssl-dev : Depends: libssl1.0.0 (= 1.0.1t-1+deb7u2) but 1.0.1t-1+deb8u6 is installed.
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     libssl-dev [Not Installed]                         



Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

     Downgrade the following packages:                                      
1)     libssl1.0.0 [1.0.1t-1+deb8u6 (now) -> 1.0.1t-1+deb7u2 (oldoldstable)]



Accept this solution? [Y/n/q/?] y
The following packages will be DOWNGRADED:
  libssl1.0.0 
The following NEW packages will be installed:
  libssl-dev libssl-doc{a} 
0 packages upgraded, 2 newly installed, 1 downgraded, 0 to remove and 12 not upgraded.
Need to get 3,825 kB of archives. After unpacking 6,420 kB will be used.
Do you want to continue? [Y/n/?] y
Get: 1 http://mirrors.aliyun.com/raspbian/raspbian/ wheezy/main libssl1.0.0 armhf 1.0.1t-1+deb7u2 [1,070 kB]
Get: 2 http://mirrors.aliyun.com/raspbian/raspbian/ wheezy/main libssl-dev armhf 1.0.1t-1+deb7u2 [1,528 kB]
Get: 3 http://mirrors.aliyun.com/raspbian/raspbian/ wheezy/main libssl-doc all 1.0.1t-1+deb7u2 [1,227 kB]
Fetched 3,825 kB in 5s (753 kB/s)     
Preconfiguring packages ...
dpkg: warning: downgrading libssl1.0.0:armhf from 1.0.1t-1+deb8u6 to 1.0.1t-1+deb7u2
(Reading database ... 115760 files and directories currently installed.)
Preparing to unpack .../libssl1.0.0_1.0.1t-1+deb7u2_armhf.deb ...
Unpacking libssl1.0.0:armhf (1.0.1t-1+deb7u2) over (1.0.1t-1+deb8u6) ...
Selecting previously unselected package libssl-dev.
Preparing to unpack .../libssl-dev_1.0.1t-1+deb7u2_armhf.deb ...
Unpacking libssl-dev (1.0.1t-1+deb7u2) ...
Selecting previously unselected package libssl-doc.
Preparing to unpack .../libssl-doc_1.0.1t-1+deb7u2_all.deb ...
Unpacking libssl-doc (1.0.1t-1+deb7u2) ...
Processing triggers for man-db (2.7.5-1~bpo8+1) ...
Setting up libssl1.0.0:armhf (1.0.1t-1+deb7u2) ...
Setting up libssl-dev (1.0.1t-1+deb7u2) ...
Setting up libssl-doc (1.0.1t-1+deb7u2) ...
Processing triggers for libc-bin (2.19-18+deb8u10) ...
此,问题解决,以后遇到版本不对导致依赖不对应的问题也可以采用上述的方法进行解决。


参考地址:http://blog.csdn.net/andy812110/article/details/24842219


  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值