美文网首页
Ubuntu 16.04 SSH安装失败的解决方案

Ubuntu 16.04 SSH安装失败的解决方案

作者: Mjolnir1107 | 来源:发表于2018-04-24 16:39 被阅读0次

问题描述

实验课需要用到SSH,命令是apt-get install ssh,结果出现了错误信息:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package ssh 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
However the following packages replace it:
  openssh-client

E: Package 'ssh' has no installation candidate

网上寻找解决办法发现可以用apt-get update解决,遂执行之,然后在超长的等待之后还是不能用,这是因为ubuntu中默认使用的是官网的源,需要翻墙,这里可以用国内的源去替代,通过修改/etc/apt/sources.list来修改源。

解决方案

  1. 打开源列表文件sudo gedit /etc/apt/sources.list
  2. 打开清华大学开源软件镜像站
  3. 将源列表替换成清华源,我这里是Ubuntu 16.04
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
  1. 再执行sudo apt-get update
  2. 再安装SSHapt-get install ssh就完全没有问题了;

相关文章

网友评论

      本文标题:Ubuntu 16.04 SSH安装失败的解决方案

      本文链接:https://www.haomeiwen.com/subject/jjmjlftx.html