我在 Ubuntu 12.04 桌面上安装 openssh 服务器和客户端时遇到问题。
我想创建一个家庭服务器,但我是 Windows 用户,我需要一个图形界面。首先,我使用命令sudo apt-get update
并更新了所有内容。当我输入:sudo apt-get 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:5.9p1-5ubuntu1) but 1:5.9p1-5ubuntu1.1 is 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.
我是 Linux 新手,我在 Google 上搜索了错误或问题,但没有得到答案 :/
有人可以帮忙吗?
答案1
我也遇到过同样的问题。我试过了,它对我有用。
sudo apt-get install openssh-client=1:5.9p1-5ubuntu1
sudo apt-get install openssh-server
答案2
发布这个帖子是因为我花了太多的时间来解决这个问题:
MadMike 的回答几乎让我明白了...我必须做的是:
sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu precise main restricted"
sudo apt-get update
sudo apt-get install openssh-client=1:5.9p1-5ubuntu1
sudo apt-get install openssh-server
您已经完成了!
答案3
在全新安装 Ubuntu 12.04.5 Desktop i386 时,我遇到了同样的问题。
sudo apt-get install e2fslibs=1.42-1ubuntu2
sudo apt-get install openssh-client=1:5.9p1-5ubuntu1
sudo apt-get install openssh-server=1:5.9p1-5ubuntu1
这帮我解决了这个问题。
答案4
@终端
检查架构
user@precise_12_04:~$ lscpu
Architecture: i686
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
@Web 浏览器(ps Firefox)
浏览至 https://launchpad.net/ubuntu/+source/openssh/1:5.9p1-5ubuntu1
选择“构建”我的是“i386”
选择“二进制包” (一次一个)
openssh-client 1:5.9p1-5ubuntu1 (用于依赖项)
openssh-server 1:5.9p1-5ubuntu1
复制“可下载文件”
http://launchpadlibrarian.net/99631526/openssh-client_5.9p1-5ubuntu1_i386.deb
http://launchpadlibrarian.net/99631527/openssh-server_5.9p1-5ubuntu1_i386.deb
@终端
下载客户端和服务端
user@precise_12_04:~$ wget http://launchpadlibrarian.net/99631526/openssh-client_5.9p1-5ubuntu1_i386.deb
user@precise_12_04:~$ wget http://launchpadlibrarian.net/99631527/openssh-server_5.9p1-5ubuntu1_i386.deb
本地安装
user@precise_12_04:~$ sudo dpkg -i openssh-client_5.9p1-5ubuntu1_i386.deb
user@precise_12_04:~$ sudo dpkg -i openssh-server_5.9p1-5ubuntu1_i386.deb
检查服务是否正在运行
user@precise_12_04:~$ service ssh status
检查开放端口
user@precise_12_04:~$ netstat -tlnp | grep 22
完毕