Ubuntu 16.04- Package has no installation candidate解決方式,Ubuntu正確安裝openssl-server的方法

  Ubuntu 17.04 安裝完虛擬機以後,若是想裝ssh軟件進行鏈接,發現幾乎全部的包都裝不成功。javascript

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.listjava

sudo cp -i /etc/apt/sources.list /etc/apt/sources.list.backup

(2)更新repos ubuntu

將如下的內容添加到/etc/apt/sources.list(或者將原來的內容清空再添加下面的源)ssh

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 

 (3)更新:ui

sudo apt-get update

 (4)安裝spa

sudo apt-get install openssh-server

  而後就能安裝成功了,若是遇到版本依賴的衝突,先按照提示安裝對應的依賴版本:如rest

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

  再正常安裝對應的軟件包就能夠了code

相關文章
相關標籤/搜索