欢迎光临
我们一直在努力

Ubuntu 16.04- Package has no installation candidate解决方式,Ubuntu正确安装openssl-server的方法

Ubuntu 16.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
sudo cp -i /etc/apt/sources.list /etc/apt/sources.list.backup

(2)更新repos

将以下的内容添加到/etc/apt/sources.list(或者将原来的内容清空再添加下面的源)

1
2
3
4
5
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

或者试试:

deb http://archive.ubuntu.com/ubuntu xenial main restricted universe
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe
deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
deb http://archive.canonical.com/ubuntu xenial partner

(3)更新(重要)

1
sudo apt-get update

(4)安装

1
sudo apt-get install openssh-server

然后就能安装成功了,如果遇到版本依赖的冲突,先按照提示安装对应的依赖版本:如

1
apt install openssh-client=1:6.6p1-2ubuntu2.10

再正常安装对应的软件包就可以了

赞(0) 打赏
未经允许不得转载:鲁巴客视界娱乐 » Ubuntu 16.04- Package has no installation candidate解决方式,Ubuntu正确安装openssl-server的方法
分享到: 更多 (0)

评论 抢沙发

评论前必须登录!

 

鲁巴客 更专业 更方便

联系电话:0721-34568743邮件联系: admin@day8x.com

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏