Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I run a 64-bit version of CentOS5. At the moment, when I run Yum updates or installs, unless Yum is purged of i386 packages prior, it will install i386 packages when x86_64 are available.

Is it possible for Yum to install x86_64 packages as first preference and then if no 64-bit packages are available, install i386 packages instead?

I know that I can set preferences so that only 64-bit packages are installed, but I don't want to do this, as it prevents 32-bit packages from being installed if they're the only option.

share|improve this question

marked as duplicate by John WH Smith, Anthon, Networker, Gilles linux Dec 29 '14 at 22:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 9 down vote accepted

Set multilib_policy=best in your yum.conf, it defaults to 'all' so it installs both i386 and x86_64 packages. When you set it to 'best' it will only install i386 if there is no x86_64 version.

From the CentOS 5 yum.conf man page:

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.
share|improve this answer
Ahh, okay. That sounds like the answer I'm looking for, thanks! I'd vote it up, but I don't have enough points. – James Jun 28 '12 at 7:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.