在 18.04.2 上安装 smbclient 和 openssh-server 时出现问题

在 18.04.2 上安装 smbclient 和 openssh-server 时出现问题

完全的 Linux 新手,尝试使用 Ubuntu 以便学习。当我尝试在全新安装的 18.04.2 上安装 SMB 客户端和 Open SSh 服务器时,出现以下错误。有人可以帮忙吗?

root@ubuntu:~# apt-get install smbclient
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:
 smbclient : Depends: samba-libs (= 2:4.7.6+dfsg~ubuntu-0ubuntu2) but 2:4.7.6+dfsg~ubuntu-0ubuntu2.6 is to be installed
E: Unable to correct problems, you have held broken packages.



root@ubuntu:~# 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.6p1-4)
                  Depends: openssh-sftp-server 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.

答案1

对于 openssh-server 的问题,我通过以下方式解决:( sudo apt-get install openssh-client=1:7.6p1-4复制消息中提到的版本以手动安装所需的依赖版本)

答案2

运行这些命令后它起作用了:

sudo apt-get install openssh-client=1:8.2p1-4

sudo apt-get install openssh-server

答案3

尝试运行“apt-get install -f”。如果不起作用,请运行“apt update”、“apt-get update”,然后再次运行“apt-get install -f”。为了将来监控损坏的软件包,请通过运行“apt install synaptic”来安装 Synaptic。当 Synaptic 启动时,它会在窗口底部通知您损坏的软件包。

答案4

openssh-client 将作为依赖项自动安装。因此请先清除它,然后执行 openssh-server 安装。

sudo apt purge openssh-客户端

sudo apt-get 安装 openssh-server

相关内容