apt-get依赖关系问题Open-SSH客户端


10

这是在Ubuntu 12.04服务器上。

尝试运行任何apt-get install(尝试安装不相关的任意软件包)时出现此错误:

dpkg: dependency problems prevent configuration of openssh-server:
 openssh-server depends on openssh-client (= 1:5.9p1-5ubuntu1.1); however:
  Version of openssh-client on system is 1:5.9p1-5ubuntu1.4.
dpkg: error processing openssh-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency probms prevent configuration of ssh:
 ssh depends on openssh-server; however:
  Package openssh-server is not configured yet.
dpkg: error processing ssh (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encounter while processing:
 openssh-server
 ssh
E: Sub-process /usr/bin/dpkg returned an error code (1)

安装有问题的客户端版本会导致:

sudo apt-get install openssh-client=1:5.9p1-5ubuntu1.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '1:5.9p1-5ubuntu1.1' for 'openssh-client' was not found

在缺乏背景知识的情况下进行各种修复的尝试失败,例如

dpkg-reconfigure -a
apt-get -f install

有人可以提供建议如何解决问题,可能需要我提供更多必要的信息吗?

如何恢复openssh更新(我猜是失败的)或使其失去焦点,以便能够安装其他软件包?

编辑:

输出apt-cache policy openssh-client为:

openssh-client:
  Installed: 1:5.9p1-5ubuntu1.4
  Candidate: 1:5.9p1-5ubuntu1.4
  Version table:
 *** 1:5.9p1-5ubuntu1.4 0
        500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1:5.9p1-5ubuntu1.3 0
        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
     1:5.9p1-5ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages

出于完整性考虑/etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse

此输出为您带来什么?apt-cache policy openssh-client显然,您正在尝试安装未使用当前的openssh-client开发或测试的软件包
JoKeR 2015年

参见上面的输出作为编辑。我宁愿不安装客户端,而只是想从安装冲突中清除它以安装其他软件包。
rdoubleui 2015年

1
在这里,您将找到可以应用askubuntu.com/questions/140246/…的
JoKeR 2015年

删除这些软件包,添加答案
Faizan Akram Dar

Answers:


18

只需删除这些软件包,即可将其apt用于其他软件包。在终端中执行此命令。

sudo apt-get remove openssh-server openssh-client --purge && sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get update

然后重新安装openssh服务器和客户端。

sudo apt-get install openssh-server openssh-client

4
我不想删除openssh-server,因为我是通过ssh连接到这台机器的。
rdoubleui 2015年

仅仅删除客户端也会导致相同的依赖项错误。
rdoubleui 2015年

删除服务器,然后重新安装服务器和客户端
Faizan Akram Dar

2
删除ssh openssh-server和openssh-client并重新安装对我有用,谢谢。
rdoubleui 2015年

没有为我工作。仍在搜索中。
DimiDak

-1

删除/清除openssh-server和openssh-client时(例如,当另一个软件包依赖它们时)

这对我有用:

sudo dpkg -i /var/cache/apt/archives/openssh-*.deb
sudo dpkg --configure -a
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.