ubuntu安裝openssh-server 報依賴錯誤的解決過程
ubuntu自帶的有openssh-client,所以可以通過
1
|
ssh username@host |
來遠程連接Linux
可是要想通過ssh被連接,ubuntu系統需要有openssh-server,可以通過
1
|
ps -e grep ssh |
來查看,如果沒有顯示sshd則說明沒有安裝openssh-server
可通過
1
|
sudo apt-get install openssh-server |
來安裝openssh-server,如果順利的話會安裝成功,如果遇到
1
2
3
4
5
6
7
8
9
10
11
12
|
$ sudo apt-get install openssh-server 正在讀取軟件包列表... 正在分析軟件包的依賴關係樹 正在讀取狀態信息... 有一些軟件包無法被安裝。如果您用的是 因爲系統無法達到您要求的狀態造成的。該版本中可能會有一些您需要的軟件 包尚未被創建或是它們已被從新到(Incoming)目錄移出。 下列信息可能會對解決問題有所幫助: 下列軟件包有未滿足的依賴關係: openssh-server E: |
這是因爲,openssh-server是依賴於openssh-clien的,那ubuntu不是自帶了openssh-client嗎?原由是自帶的openssh-clien與所要安裝的openssh-server所依賴的版本不同,這裏所依賴的版本是
1
|
1:6.6p1-2ubuntu1 |
所以要安裝對應版本的openssh-clien,來覆蓋掉ubuntu自帶的
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
$ sudo apt-get install openssh-client=1:6.6p1-2ubuntu1 正在讀取軟件包列表... 正在分析軟件包的依賴關係樹 正在讀取狀態信息... 建議安裝的軟件包: libpam- ssh keychain 下列軟件包將被【降級】: openssh-client 升級了 需要下載 解壓縮後會消耗掉 您希望繼續執行嗎? /n ] 獲取:1 //cn .archive.ubuntu.com /ubuntu/ trusty /main openssh-client 下載 /s ) dpkg:警告:downgrading (正在讀取數據庫 Preparing /openssh-client_1 %3a6.6p1-2ubuntu1_amd64.deb Unpacking Processing for man -db 正在設置 |
可以看到,提示了系統中openssh-client被降級,這樣再安裝openssh-server就可以成功了!