我在一台装有 64 位 Mint 17.3 Cinnamon 的机器上面临以下情况:
$ sudo apt-get install openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
openssh-client:i386 openssh-sftp-server
Suggested packages:
ssh-askpass:i386 libpam-ssh:i386 keychain:i386 monkeysphere:i386 rssh
molly-guard monkeysphere
Recommended packages:
ncurses-term ssh-import-id
The following packages will be REMOVED:
openssh-client
The following NEW packages will be installed:
openssh-client:i386 openssh-server openssh-sftp-server
0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded.
Need to get 928 kB of archives.
After this operation, 1 418 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
我不明白为什么它要删除 64 位 openssh-client 并安装 32 位。
/etc/apt/sources.list
#deb cdrom:[Linux Mint 17.3 _Rosa_ - Release amd64 20151115]/ trusty contrib main non-free
/etc/apt/sources.list.d 文件夹包含许多 PPA:
doublecmd.list
esmska.list
getdeb.list
google-chrome.list
graphics-drivers-ppa-trusty.list
inkscape_dev-stable-trusty.list
mono-xamarin.list
nijel-phpmyadmin-trusty.list
n-muench-programs-ppa2-trusty.list
official-package-repositories.list
official-source-repositories.list
ondrej-php-trusty.list
otto-kesselgulasch-gimp-trusty.list
playonlinux.list
spideroakone.list
spotify.list
steam.list
strukturag-libde265-trusty.list
ubuntu-sdk-team-ppa-trusty.list
ubuntu-touch-coreapps-drivers-daily-trusty.list
unit193-encryption-trusty.list
videolan-master-daily-trusty.list
virtualbox.list
wfg-0ad-trusty.list
wine.list
apt-get 更新
Reading package lists... Done
我看不出有任何错误。
apt-get -o Debug::pkgProblemResolver=true 安装 openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
The following extra packages will be installed:
openssh-client:i386 openssh-sftp-server
Suggested packages:
ssh-askpass:i386 libpam-ssh:i386 keychain:i386 monkeysphere:i386 rssh
molly-guard monkeysphere
Recommended packages:
ncurses-term ssh-import-id
The following packages will be REMOVED:
openssh-client
The following NEW packages will be installed:
openssh-client:i386 openssh-server openssh-sftp-server
0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded.
Need to get 928 kB of archives.
After this operation, 1,418 kB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.
apt-cache 策略 openssh-client openssh-server
openssh-client:
Installed: 1:6.6p1-2ubuntu2.6
Candidate: 1:6.6p1-2ubuntu2.6
Version table:
*** 1:6.6p1-2ubuntu2.6 0
100 /var/lib/dpkg/status
1:6.6p1-2ubuntu2.4 0
500 http://archive.ubuntu.mirror.dkm.cz/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
1:6.6p1-2ubuntu1 0
500 http://archive.ubuntu.mirror.dkm.cz/ trusty/main amd64 Packages
openssh-server:
Installed: (none)
Candidate: 1:6.6p1-2ubuntu2.4
Version table:
1:6.6p1-2ubuntu2.4 0
500 http://archive.ubuntu.mirror.dkm.cz/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
1:6.6p1-2ubuntu1 0
500 http://archive.ubuntu.mirror.dkm.cz/ trusty/main amd64 Packages
答案1
根据您的apt-cache policy
输出,您已openssh-client
1:6.6p1-2ubuntu2.6
安装,但这不对应于任何 URL,并且版本号与服务器版本号不同。
Debian ssh 软件包要求客户端和服务器版本完全匹配。
apt
那么,为什么要删除您已安装amd64
的版本就很清楚了。openssh-client
不太清楚的是为什么它尝试i386
安装openssh-client
.
所以,只需这样做:
apt-get purge openssh-client
然后安装openssh-client
和openssh-server
。
apt-get install openssh-client openssh-server
PS:朱利安·安德烈斯·克洛德 (Julian Andres Klode) 的解释#debian-apt
。
juliank> faheem:必须降级 amd64 版本,这是被禁止的。但 :i386 显然可以满足对其他架构(Multi-Arch:foreign)的依赖关系,因此它可以安装它。
满足对其他架构的依赖似乎有点古怪,但我认为i386
客户端可能与服务器一起工作amd64
。