OpenSSH 服务器安装导致错误 E:无法纠正问题,您持有损坏的软件包

Pur*_*uro 2 ubuntu apt openssh

我尝试在 Ubuntu 16.04 上安装 OpenSSH 服务器,如下所示:

sudo apt-get install openssh-server
Run Code Online (Sandbox Code Playgroud)

但是,它显示以下消息:

dell@dell-Latitude-E6400:~$ sudo apt-get install openssh-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
 openssh-server : Depends: openssh-client (= 1:7.2p2-4) but 1:7.2p2-4ubuntu2.8 is to be installed
                  Depends: openssh-sftp-server but it is not going to be installed
                  Recommends: ncurses-term but it is not going to be installed
                  Recommends: ssh-import-id but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Run Code Online (Sandbox Code Playgroud)

小智 7

试试这个对我有用的。

sudo apt purge openssh-client
Run Code Online (Sandbox Code Playgroud)

实际上 openssh-client 已安装在您的系统上,您必须先将其删除,然后使用此命令安装 openssh-server。

sudo apt install openssh-server
Run Code Online (Sandbox Code Playgroud)