我正在尝试安装 libgtk1.2,但是安装失败。
sudo dpkg -i libgtk1.2_1.2.10-18.1build2_i386.deb
Selecting previously unselected package libgtk1.2:i386.
(Reading database ... 226813 files and directories currently installed.)
Preparing to unpack libgtk1.2_1.2.10-18.1build2_i386.deb ...
Unpacking libgtk1.2:i386 (1.2.10-18.1build2) ...
dpkg: libgtk1.2:i386: dependency problems, but configuring anyway as you requested:
libgtk1.2:i386 depends on libgtk1.2-common (>= 1.2.10-18.1build2).
Setting up libgtk1.2:i386 (1.2.10-18.1build2) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
它在 libgtk1.2-common 依赖项上失败,但我已经安装了它。
apt list --installed | grep libgtk
...
libgtk1.2/now 1.2.10-18.1build2 i386 [installed,local]
libgtk1.2-common/now 1.2.10-18.1build2 all [installed,local]
...
libgtk1.2-common 是作为 deb 安装的。libgtk1.2 的依赖项正在寻找 1.2.10-18.1build2,它与我已安装的 libgtk1.2-common 相匹配。
为什么 libgtk1.2 无法看到依赖项?我该如何修复?
注意,我知道 libgtk1.2 已经过时了,但我需要一个较旧的应用程序。另外需要注意的是,如果我保留已损坏的 libgtk1.2,我使用的应用程序仍可运行,但这意味着我无法再安装任何软件包。任何新软件都要求我运行“sudo apt-get -f install”,这将删除 libgtk1.2(因为它已损坏)。
编辑:我猜是因为通用包是“全部”包,所以 i386 libgtk1.2 无法将其视为已安装包。但不确定如何继续操作才能使其正常运行。
编辑:这是请求的命令输出。
sudo apt-get -f installReading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
libxi6:i386
Use 'sudo apt autoremove' to remove it.
The following packages will be REMOVED:
libgtk1.2:i386
0 upgraded, 0 newly installed, 1 to remove and 11 not upgraded.
1 not fully installed or removed.
After this operation, 1,876 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 226826 files and directories currently installed.)
Removing libgtk1.2:i386 (1.2.10-18.1build2) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
答案1
解决方案
dpkg-deb -x libgtk1.2-common_1.2.10-18.1build2_all.deb tmp
dpkg-deb --control libgtk1.2-common_1.2.10-18.1build2_all.deb tmp/DEBIAN
vi tmp/DEBIAN/control
--add the following line >> Multi-Arch: foreign
dpkg -b tmp libgtk1.2-common_1.2.10-18.1build2_all_new.deb
sudo dpkg -i libgtk1.2-common_1.2.10-18.1build2_all_new.deb
sudo apt-get -f install
sudo dpkg -i libgtk1.2_1.2.10-18.1build2_i386.deb
sudo apt-get -f install
通过修改 deb 以支持外部 Multi-Arch,它允许 libgtk1.2 看到 libgtk1.2-common。libgtk1.2 是 i386,而我在 x86_64 上。如果不进行修改,libgtk1.2 就看不到 libgtk1.2-common。