安装openssh-server报E: Unable to correct problems, you have held broken packages

一、通过ssh连接,ubuntu系统需要有openssh-server,可以通过
ps -e|grep ssh 来查看,
显示如下:

7153 ? 00:00:00 sshd
7222 ? 00:00:00 sshd
7262 ? 00:00:00 sshd
如果没有显示sshd则说明没有安装openssh-server。

二、安装ssh
sudo apt-get install openssh-server
安装openssh-server,如果顺利的话会安装成功,如果遇到以下问题:

openssh-server : Depends: openssh-client (= 1:7.2p2-4ubuntu2.1)
Depends: openssh-sftp-server but it is not going to be installed
Recommends: ncurses-term but it is not installable
Recommends: ssh-import-id but it is not installable
E: Unable to correct problems, you have held broken packages.

原因如下:

这是因为,openssh-server是依赖于openssh-clien的,那ubuntu不是自带了openssh-client吗?

原由是自带的openssh-clien与所要安装的openssh-server所依赖的版本不同,这里所依赖的版本是:

1:7.2p2-4ubuntu2.1

所以要安装对应版本的openssh-clien,来覆盖掉ubuntu自带的

sudo apt-get install openssh-client=1:7.2p2-4ubuntu2.1

这样再安装openssh-server就可以成功了。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值