Ubuntu 17.04 安装完虚拟机之后,如果想装ssh软件进行连接,发现几乎所有的包都装不成功。
root@zengxijin-va:/home/zengxijin# apt-get install openssh-server Reading package lists... Done Building dependency tree Reading state information... Done Package openssh-server 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 'openssh-server' has no installation candidate
报的报错都是Package ‘xxx’ has no installation candidate。
解决办法:
(1)备份/etc/apt/sources.list
1 |
|
(2)更新repos
将以下的内容添加到/etc/apt/sources.list(或者将原来的内容清空再添加下面的源)
1 2 3 4 5 |
|
(3)更新:
1 |
|
(4)安装
1 |
|
然后就能安装成功了,如果遇到版本依赖的冲突,先按照提示安装对应的依赖版本:如
1 |
|
再正常安装对应的软件包就可以了
预见方能遇见。
//-----------------------------------------------
ubuntu 18.04: Unable to locate package openssh-service
ubuntu开启ssh服务时,需要安装 openssh-service,如果报错 Unable to locate package openssh-service,则
1. sudo apt update
2. sudo apt upgrade
3. sudo apt install -y openssh-server
---------------------
作者:必有缺
来源:CSDN
原文:https://blog.csdn.net/qq_38004174/article/details/87896135
版权声明:本文为博主原创文章,转载请附上博文链接!