解决openssh-server : Depends: libwrap0( = 7.6-4~)

安装Ubuntu openssh-server的时候遇到这样的问题:

root@ubuntu:~# apt-get install openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be install. 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:
openssh-server : Depends: libwrap0(>= 7.6-4~) but it is not installable
              Recommends: ssh-import-id but it is not installable
E: Unable to correct problems, you have held broken packages.

执行apt-update

root@ubuntu:~# apt-get update
......
W: Failed to fetch bzip2: /var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_precise_binary-i386_Packages  Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.

安装libwrap0

root@ubuntu:~# apt-get install libwrap0
...
Package libwrap0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
E: Package libwrap0 has no installation candidate

这里是安装源的问题,更换安装源

root@ubuntu:~# cp /etc/apt/sources.list ~/sources.list.old
root@ubuntu:~# sed -i 's/us.archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
root@ubuntu:~# diff ~/sources.list.old /etc/apt/sources.list | wc -l
root@ubuntu:~# diff ~/sources.list.old /etc/apt/sources.list | tail

执行apt-update

root@ubuntu:~# apt-get update
Get:79 http://mirrors.aliyun.com precise-backports/restricted Translation-en [14 B]
Get:80 http://mirrors.aliyun.com precise-backports/universe Translation-en [34.2 kB]
Fetched 28.0 MB in 23s (1,207 kB/s)
Reading package lists... Done

安装openssh-server

root@ubuntu:~# apt-get install openssh-server

检查状态

root@ubuntu:~# service ssh status
ssh start/running, process 1975
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值