Yum

yum: gcc 試圖在 x86_64 伺服器上安裝 i686 架構

  • February 1, 2019

嘗試YUM install gcc gcc-g++ make並失敗:

Package: glibc-2.17-260.el7.i686 (RHEL_SEC_7)
      Requires: glibc-common = 2.17-260.el7
      Installed: glibc-common-2.17-260.el7_6.3.x86_64 (@anaconda/7.6)
          glibc-common = 2.17-260.el7_6.3
      Available: glibc-common-2.17-55.el7.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-55.el7
      Available: glibc-common-2.17-55.el7_0.1.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-55.el7_0.1
      Available: glibc-common-2.17-55.el7_0.3.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-55.el7_0.3
      Available: glibc-common-2.17-55.el7_0.5.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-55.el7_0.5
      Available: glibc-common-2.17-78.el7.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-78.el7
      Available: glibc-common-2.17-105.el7.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-105.el7
      Available: glibc-common-2.17-106.el7_2.1.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-106.el7_2.1
      Available: glibc-common-2.17-106.el7_2.4.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-106.el7_2.4
      Available: glibc-common-2.17-106.el7_2.6.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-106.el7_2.6
      Available: glibc-common-2.17-106.el7_2.8.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-106.el7_2.8
      Available: glibc-common-2.17-157.el7.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-157.el7
      Available: glibc-common-2.17-157.el7_3.1.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-157.el7_3.1
      Available: glibc-common-2.17-157.el7_3.2.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-157.el7_3.2
      Available: glibc-common-2.17-157.el7_3.4.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-157.el7_3.4
      Available: glibc-common-2.17-157.el7_3.5.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-157.el7_3.5
      Available: glibc-common-2.17-196.el7.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-196.el7
      Available: glibc-common-2.17-196.el7_4.2.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-196.el7_4.2
      Available: glibc-common-2.17-222.el7.x86_64 (RHEL_7.6)
          glibc-common = 2.17-222.el7
      Available: glibc-common-2.17-260.el7.x86_64 (RHEL_SEC_7)
          glibc-common = 2.17-260.el7

但是, yum list --showduplicates glibc顯示的輸出:

Installed Packages
glibc.x86_64                   2.17-260.el7_6.3                   @anaconda/7.6 

yum list --showduplicates glibc-common顯示:

Installed Packages
glibc-common.x86_64               2.17-260.el7_6.3                @anaconda/7.6 

節目輸出的片段yum -v -y install gcc gcc-c++ make

Package glibc.i686 0:2.17-260.el7 will be installed

為什麼 yum 會嘗試混合架構?如何強制 yum 僅安裝 x86_64 依賴項?

這個gcc包有點特別,因為它裡面的編譯器可以生成 32 位和 64 位庫。為此,它需要一些基本的 i686 系統庫(libgccglibc)。除了重新編譯編譯器以禁用 32 位支持之外,您無能為力。

你最好弄清楚為什麼glibc.i686無法安裝。看起來像版本不匹配,可能是由於 repos 的不兼容組合(您已安裝的el7_6.3版本glibc-common,但glibc.i686包需要el7)。

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