Get Yum to prefer x86_64 instead of i386 RPMs
Login | Register RSS
09/29/2012 - Linux 

Get Yum to prefer x86_64 instead of i386 RPMs

If you run into case where you're running a 64-bit version of CentOS or Fedora, and Yum seams to prefer 32-bit packages, even though 64-bit packages exist, here is how to fix it.

To address this, you will need to add the following to your "/etc/yum.conf" file.

multilib_policy=best
It appears that the 'multilib_policy' setting defaults to 'all', which installs both the i386 and x86_64 versions.  But when you set the value to 'best', yum will only install the 32-bit package when no x86_64 package is available.

As taken 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.

Once you apply the change, the 64-bit versions will be preferred.  At this point you are done, if you don't want to do anything else.

However in many cases, you may want to remove all the 32-bit versions of RPMs you don't really need any more, leaving just the x86_64 versions behind.

To remove all the 32-bit RPP packages from your system, use this command:

yum remove \*.i\?86
Now if you want to keep the system 64-bit pure, you can opt to prevent any further 32-bit RPMs from being installed.  To keep any 32-bit packages from being installed in future updates, you would need to edit your "/etc/yum.conf" file and add this line:

exclude=*.i?86
Please be aware that 32-bit applications, including some browser plugins that may only be available in 32-bit versions, will no longer work after this procedure.

Lastly, you may also want to run this command, so that all your existing packages are reinstalled:

yum reinstall \*
The reason is that sometimes the "/usr/share/..." items (shared between BOTH packages) get removed when removing the 32-bit RPM packages.  This will reinstall all of your remaining RPM packages, which reinstalls any missing binaries/files, as necessary.


If you like this site or any of its content, please help promote it. Use the social media buttons below to help spread the word. Don't forget to post in the comments section.

  Print   Email