解决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.
1
2
3
4
5
6
7
8
9
10
11
执行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.
1
2
3
4
5
安装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
1
2
3
4
5
6
这里是安装源的问题,更换安装源
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
1
2
3
4
5
执行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
1
2
3
4
5
6
安装openssh-server
root@ubuntu:~# apt-get install openssh-server
1
2
检查状态
root@ubuntu:~# service ssh status
ssh start/running, process 1975
使用这个博主的方法,SSH完美开启,OK!
本文详细记录了在Ubuntu系统中安装openssh-server时遇到的依赖问题及解决方案,通过更换安装源,成功解决了libwrap0依赖缺失的问题,最终实现了SSH服务的正常启动。
1064

被折叠的 条评论
为什么被折叠?



