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

    xiaoxiao2021-03-25  91

    安装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
    转载请注明原文地址: https://ju.6miu.com/read-26020.html

    最新回复(0)