Yum 能否表達對 x86_64 而非 i386 軟體包的偏好?

Yum 能否表達對 x86_64 而非 i386 軟體包的偏好?

我運行的是 64 位元版本的 CentOS5。目前,當我執行 Yum 更新或安裝時,除非事先清除 Yum 中的 i386 軟體包,否則它將在 x86_64 可用時安裝 i386 軟體包。

Yum 是否可以先安裝 x86_64 軟體包,然後如果沒有可用的 64 位元軟體包,則安裝 i386 軟體包?

我知道我可以設置偏好設置,以便僅有的安裝了 64 位元軟體包,但我不想這樣做,因為如果 32 位元軟體包是唯一的選擇,它會阻止安裝 32 位元軟體包。

答案1

在 yum.conf 中設置multilib_policy=best,預設為“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.

相關內容