与 i386 软件包相比,Yum 能否表达对 x86_64 的偏好?

Jam*_*mes 6 linux yum 64bit centos

我运行的是 64 位版本的 CentOS5。目前,当我运行 Yum 更新或安装时,除非 Yum 事先清除了 i386 包,否则它会在 x86_64 可用时安装 i386 包。

Yum 是否可以将 x86_64 软件包作为首选安装,然后如果没有 64 位软件包可用,则安装 i386 软件包?

我知道我可以设置首选项以便安装 64 位软件包,但我不想这样做,因为如果 32 位软件包是唯一选项,它会阻止安装。

Mar*_*try 10

multilib_policy=best在 yum.conf 中设置,它默认为“all”,因此它安装 i386 和 x86_64 包。当您将其设置为“最佳”时,它只会在没有 x86_64 版本的情况下安装 i386。

从 CentOS 5 yum.conf 手册页:

multilib_policy - Can be set to ’all’ or ’best’. All means
install all possible arches for any package you  want  to
install.  Therefore yum install foo will install foo.i386
and foo.x86_64 on x86_64, if it is available. Best  means
install the best arch for this platform, only.
Run Code Online (Sandbox Code Playgroud)