RHEL5: Forbid installation of i386 packages on 64-bit systems?

Solution 1:

Add multilib_policy=best to your /etc/yum.conf

Yum will now try to install the "best" package.arch for your system and it will only install that one (as long as it is available).

Assuming you're on a 64-Bit system, yum will first try to install package.x86_64, if that doesn't exist it will fall back to i386 and noarch.

The default setting is multilib_policy=all, which means to install all possible arches.

Solution 2:

I've been using option exactarch=1 in /etc/yum.conf for some time, and it has worked for me.

It still allows you to manually specify arch, but if you don't, it install only x86_64, not both.

According to el6 manual, yum.conf(5):

          exactarch  Either  ‘1’  or ‘0’. Set to ‘1’ to make yum update only update the architectures of
          packages that you have installed. ie: with this enabled yum will not install an  i686  package
          to update an i386 package. Default is ‘1’.

...

          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.

BTW, both multilib_policy=best and exactarch=1 seem to be the default for some time now.


Solution 3:

Use the exclude function in yum.conf:

exclude=*.i386 *.i686