我想安装 openssh-server,因此我执行以下操作:
erik@workstationubuntu:~$ sudo apt-get install openssh-server
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:
dassault-systemes-draftsight:i386 : PreDepends: libdirectfb-extra:i386 (>= 1.2.7-2) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
erik@workstationubuntu:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
dassault-systemes-draftsight:i386
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
After this operation, 297 MB disk space will be freed.
Do you want to continue [Y/n]? n
erik@workstationubuntu:~$ sudo apt-get install libdirectfb-extra:i386
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:
libdirectfb-extra:i386 : Depends: libdirectfb-1.2-9:i386 (= 1.2.10.0-4.3ubuntu1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
erik@workstationubuntu:~$
erik@workstationubuntu:~$ sudo apt-get install libdirectfb-1.2-9:i386
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:
dassault-systemes-draftsight:i386 : PreDepends: libdirectfb-extra:i386 (>= 1.2.7-2) but it is not going to be installed
libdirectfb-1.2-9 : Conflicts: libdirectfb-1.2-9:i386 but 1.2.10.0-4.3ubuntu1 is to be installed
libdirectfb-1.2-9:i386 : Depends: libsysfs2:i386 but it is not going to be installed
Depends: libts-0.0-0:i386 (>= 1.0) but it is not going to be installed
Conflicts: libdirectfb-1.2-9 but 1.2.10.0-4.3ubuntu1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
erik@workstationubuntu:~$
并且这种情况还在继续!
我可以在不删除 draftsight 的情况下安装 openssh-server 吗?(请注意,安装 draftsight 时我必须使用 dpkg --force-depends(它运行完美)
答案1
依赖关系损坏的原因在于您强制安装了适用于 i386 架构的 draftsight 包。显然,您使用的是 amd64 架构,因此损坏的依赖关系会阻止您安装任何其他包。
一种可能的解决方案是暂时删除 draftsight 包,然后安装 openssh-server,然后重新安装。请注意,每次更新和升级系统时都必须执行此操作。
或者,如果您可以找到适用于 amd64 架构的软件包,您可以安装它,并且我认为您的依赖关系不会再被破坏。