apt-get 的问题:i386 命名

apt-get 的问题:i386 命名

我正在尝试在运行 64 位 Ubuntu 14.04 的 64 位计算机上为 32 位应用程序构建一个软件包。构建成功,应用程序运行正常,我还使用 debhelper 为其创建了一个 .deb,但实际安装时,出现了意外:

# apt-get install nd-tcms-agent
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:
  nd-tcms-agent:i386 : Depends: lib32gcc1:i386 (>= 1:4.1.1) but it is not installable
                  Depends: lib32stdc++6:i386 (>= 4.4.0) but it is not installable
                  Depends: libc6-i386:i386 (>= 2.17) but it is not installable
E: Unable to correct problems, you have held broken packages.

我是否提到过我的代码已成功构建?如果没有安装这些库,代码就不会成功构建!

现在,我做了以下事情:

# apt-cache showpkg lib32gcc1:i386
Package: lib32gcc1:i386
Versions:

Reverse Depends:
  nd-tcms-agent:i386,lib32gcc1:i386 1:4.1.1
Dependencies:
Provides:
Reverse Provides:

那东西去哪儿了?我发誓它一分钟前还在这儿……

猜猜是什么?!它隐藏在:i386后缀后面:

# apt-cache showpkg lib32gcc1
Package: lib32gcc1
Versions:
1:4.9.3-0ubuntu4 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_trusty-updates_main_binary-amd64_Packages) (/var/lib/dpkg/status)
 Description Language:
             File: /var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_trusty_main_binary-amd64_Packages
              MD5: a31c67d540f86442c895f2663cb4d5c9
 Description Language: de
             File: /var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_trusty_main_i18n_Translation-de
              MD5: a31c67d540f86442c895f2663cb4d5c9
 Description Language: en
             File: /var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_trusty_main_i18n_Translation-en
              MD5: a31c67d540f86442c895f2663cb4d5c9

1:4.9-20140406-0ubuntu1 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_trusty_main_binary-amd64_Packages)
 Description Language:
             File: /var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_trusty_main_binary-amd64_Packages
              MD5: a31c67d540f86442c895f2663cb4d5c9
 Description Language: de
             File: /var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_trusty_main_i18n_Translation-de
              MD5: a31c67d540f86442c895f2663cb4d5c9
 Description Language: en
             File: /var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_trusty_main_i18n_Translation-en
                  MD5: a31c67d540f86442c895f2663cb4d5c9


Reverse Depends:
  nvidia-352-updates,lib32gcc1
  nvidia-352,lib32gcc1
  nvidia-340-updates,lib32gcc1
  nvidia-340,lib32gcc1
  nvidia-304-updates,lib32gcc1
  nvidia-304,lib32gcc1
  fglrx-updates-core,lib32gcc1
  fglrx-core,lib32gcc1
  libx32go5,lib32gcc1 1:4.1.1
  libx32gcc-4.8-dev,lib32gcc1 1:4.8.4-2ubuntu1~14.04.3
  lib32stdc++6-4.8-dbg,lib32gcc1 1:4.1.1
  lib32stdc++6,lib32gcc1 1:4.1.1
  lib32objc4,lib32gcc1 1:4.1.1
  lib32go5,lib32gcc1 1:4.1.1
  lib32go4,lib32gcc1 1:4.1.1
  lib32gfortran3,lib32gcc1 1:4.4.0
  lib32gcc1-dbg,lib32gcc1 1:4.9.3-0ubuntu4
  lib32gcc-4.8-dev,lib32gcc1 1:4.8.4-2ubuntu1~14.04.3
  lib32asan0,lib32gcc1 1:4.1.1
  brother-lpr-drivers-extra,lib32gcc1 1:4.1.1
  lib32stdc++6-4.6-dbg,lib32gcc1 1:4.1.1
  lib32stdc++6-4.4-dbg,lib32gcc1 1:4.1.1
  lib32objc3,lib32gcc1 1:4.1.1
  lib32go0,lib32gcc1 1:4.1.1
  gcc-4.6-multilib,lib32gcc1 1:4.6.4-6ubuntu2
  gcc-4.4-multilib,lib32gcc1 1:4.4.7-8ubuntu1
  nvidia-331-updates,lib32gcc1
  nvidia-331,lib32gcc1
  nvidia-304-updates,lib32gcc1
  nvidia-304,lib32gcc1
  fglrx-updates,lib32gcc1
  fglrx,lib32gcc1
  libx32go5,lib32gcc1 1:4.1.1
  libx32gcc-4.8-dev,lib32gcc1 1:4.8.2-19ubuntu1
  libx32gcc-4.7-dev,lib32gcc1 1:4.7.3-12ubuntu1
  lib32stdc++6-4.8-dbg,lib32gcc1 1:4.1.1
  lib32stdc++6-4.7-dbg,lib32gcc1 1:4.1.1
  lib32stdc++6,lib32gcc1 1:4.1.1
  lib32objc4,lib32gcc1 1:4.1.1
  lib32go5,lib32gcc1 1:4.1.1
  lib32go4,lib32gcc1 1:4.1.1
  lib32gfortran3,lib32gcc1 1:4.4.0
  lib32gcc1-dbg,lib32gcc1 1:4.9-20140406-0ubuntu1
  lib32gcc-4.8-dev,lib32gcc1 1:4.8.2-19ubuntu1
  lib32gcc-4.7-dev,lib32gcc1 1:4.7.3-12ubuntu1
  lib32asan0,lib32gcc1 1:4.1.1
Dependencies:
1:4.9.3-0ubuntu4 - gcc-4.9-base (5 4.9.3-0ubuntu4) libc6-i386 (2 2.2.4)
1:4.9-20140406-0ubuntu1 - gcc-4.9-base (5 4.9-20140406-0ubuntu1) libc6-i386 (2 2.2.4)
Provides:
1:4.9.3-0ubuntu4 -
1:4.9-20140406-0ubuntu1 -
Reverse Provides:

您还应该知道,我没有Depends:手动将这些添加到我的软件包中。debhelper我做了。我知道这可能不是您的直接问题,但如果您碰巧知道那个想出绝妙主意,将 : 后缀添加到“外部”软件包的人是谁,请让我看看他,我正在寻找解决方法!

或者,可能只是我完全误解了这个混合架构的事情......

谢谢,祝你好运!

答案1

以下是我的解决方法(我确实相信这是一种解决方法,而不是解决方案!):

这是我的包裹最初的控制信息:

$ dpkg -I ../nd-tcms-agent_1.1-1_i386.deb
 new debian package, version 2.0.
 size 248492 bytes: control archive=624 bytes.
     410 bytes,    10 lines      control
     315 bytes,     4 lines      md5sums
 Package: nd-tcms-agent
 Version: 1.1-1
 Architecture: i386
 Maintainer: [email protected]
 Installed-Size: 929
 Depends: lib32gcc1 (>= 1:4.1.1), lib32stdc++6 (>= 4.4.0), libc6-i386 (>= 2.17), libcurl3-gnutls (>= 7.16.2), libzmq3 (>= 3.2.3+dfsg)
 Section: utils
 Priority: optional
 Homepage: [...]
 Description: [...]

我强调:其中的内容是根据它在构建包期间自行收集的信息Depends:添加的。debhelper

因此,我所做的是尝试自己通过添加文件来覆盖它们debian/shlibs.local

libgcc_s                1       libgcc1 (>= 1:4.1.1)
libstdc++               6       libstdc++6 (>= 4.4.0)
libm                    6       libc6 (>= 2.17)
libpthread              0       libc6 (>= 2.17)
libc                    6       libc6 (>= 2.17)

(我不会详细介绍其中的内容,网上和手册中有很多相关信息)

现在,我的包裹的控制信息如下:

$ dpkg -I ../nd-tcms-agent_1.1-1_i386.deb
 new debian package, version 2.0.
 size 248320 bytes: control archive=620 bytes.
      401 bytes,    10 lines      control
      315 bytes,     4 lines      md5sums
  Package: nd-tcms-agent
  Version: 1.1-1
  Architecture: i386
  Maintainer: [email protected]
  Installed-Size: 929
  Depends: libc6 (>= 2.17), libcurl3-gnutls (>= 7.16.2), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.4.0), libzmq3 (>= 3.2.3+dfsg)
  Section: utils
  Priority: optional
  Homepage: [...]
  Description: [...]

现在,debian/shlibs.local 中提到的所有库依赖项是否真的基于正确的 arch 正确解析,这留给你/我最好的猜测(也许我可以把任何解析为具有 :i386 变体的包的东西放进去——这就是为什么我认为这是一种解决方法,而不是解决方案!);可以肯定的是,现在我的包确实安装了(如果你遇到同样的问题,你的包也可能会安装)...

干杯!

相关内容