Linux

64bit rpm 無法解析 32bit 依賴

  • March 22, 2018

問題

我有一個包含 64 位和 32 位混合二進製文件的 RPM。其中一個二進製文件依賴於 32 位 i686 軟體包。當我嘗試安裝軟體包時,yum 給了我一個錯誤,指出該軟體包需要 32 位軟體包。但是,當我只是嘗試自己安裝所需的軟體包時,它可以完美執行。

細節

在我的規範文件中,我有

Requires:       glibc.i686 libstdc++.i686 device-mapper-libs.i686 lshw

當我嘗試在 CentOS 6.3 系統上安裝該軟體包時,我得到:

# yum update gamigo-kvm-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package gamigo-kvm-tools.x86_64 0:0.0.7-4 will be updated
---> Package gamigo-kvm-tools.x86_64 0:0.0.9-4 will be an update
--> Processing Dependency: libstdc++.i686 for package: gamigo-kvm-tools-0.0.9-4.x86_64
--> Processing Dependency: glibc.i686 for package: gamigo-kvm-tools-0.0.9-4.x86_64
--> Processing Dependency: device-mapper-libs.i686 for package: gamigo-kvm-tools-0.0.9-4.x86_64
--> Finished Dependency Resolution
Error: Package: gamigo-kvm-tools-0.0.9-4.x86_64 (gamigo-CentOS-6-x86_64-liv)
          Requires: libstdc++.i686
Error: Package: gamigo-kvm-tools-0.0.9-4.x86_64 (gamigo-CentOS-6-x86_64-liv)
          Requires: device-mapper-libs.i686
Error: Package: gamigo-kvm-tools-0.0.9-4.x86_64 (gamigo-CentOS-6-x86_64-liv)
          Requires: glibc.i686
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

但是,當我手動安裝引用的軟體包時,我得到

# yum install libstdc++.i686 device-mapper-libs.i686 glibc.i686
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Package libstdc++-4.4.6-4.el6.i686 already installed and latest version
Package device-mapper-libs-1.02.74-10.el6.i686 already installed and latest version
Package glibc-2.12-1.80.el6_3.5.i686 already installed and latest version
Nothing to do

我不太明白為什麼會發生錯誤以及它試圖告訴我什麼。我看到它只發生在 32 位軟體包中,因為第四個必需的軟體包“lshw”似乎沒問題。是否有特殊的規範文件語法來引用 32 位軟體包?

我剛剛找到了答案。我的 Requires 行應該是

Requires:       glibc(x86-32) libstdc++(x86-32) device-mapper-libs(x86-32)

http://www.rpm.org/wiki/PackagerDocs/ArchDependencies中所述

由於有人回答了 4.6 的回答——對於 4.4 版本,如果您依賴 32 位 RPM 來解決可能對其他人有用的困難或缺少語法:

Requires:      /lib/libc.so.6

由於此文件由 32 位 glibc 提供,因此安裝將引入正確的依賴項。

引用自:https://unix.stackexchange.com/questions/52455