ubuntu12.04.5安装openssh-server所引发的血案
刚安装好的ubuntu12.04.5在安装openssh-server之后,安装其他软件都安装不了,如下:
root@ubuntu:/home/lancer/software/ssh# apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
openssh-server : Depends: openssh-client (= 1:5.9p1-5ubuntu1) but 1:5.9p1-5ubuntu1.7 is to be installed
Recommends: ssh-import-id but it is not going to be installed
vim : Depends: vim-runtime (= 2:7.3.429-2ubuntu2.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
root@ubuntu:/home/lancer/software/ssh#
root@ubuntu:/home/lancer/software/ssh# apt-get remove openssh-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
openssh-server : Depends: openssh-client (= 1:5.9p1-5ubuntu1) but it is not going to be installed
Recommends: ssh-import-id but it is not going to be installed
ssh : Depends: openssh-client but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
根据网上众多教程,执行什么。。。
- apt-get -f install xxx
- sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info.bak
- sudo rm -rf /var/lib/dpkg/info //把自己新建的info文件夹删掉
- sudo mv /var/lib/dpkg/info.bak /var/lib/dpkg/info //把以前的info文件夹重新改回名字
以上都没有解决。安装其他任何软件还是提示有openssh-server : Depends: openssh-client (= 1:5.9p1-5ubuntu1) but it is not going to be installed
这是因为安装的openssh-server所依赖的openssh-client版本不对,所以会提示这个错误。
解决的方法就是安装相应的版本即可。
sudo apt-get install openssh-clien=1:5.9p1-5ubuntu1