Preventing Automatic i386 Package Installation on 64-bit RHEL5 Systems


2 views

On RHEL5 64-bit systems, yum's default behavior of installing both x86_64 and i386 versions of packages can lead to unnecessary disk space usage and potential library conflicts. This becomes particularly problematic when dealing with dependency chains where both architectures get pulled in.

RHEL5's yum implementation treats multi-arch packages differently than modern systems. The package manager doesn't automatically prioritize native architecture packages in all cases. Here's how the selection process works:

# Example showing both architectures being installed
$ yum install package
--> Processing Dependency: package.i386 = version
--> Processing Dependency: package.x86_64 = version

The most effective solution is to modify yum's configuration to exclude i386 packages:

# /etc/yum.conf
[main]
...
exclude=*.i?86
multilib_policy=best

This configuration change does three important things:

  • Explicitly excludes all i386 packages via pattern matching
  • Sets the multilib policy to prefer native architecture
  • Applies system-wide without requiring per-command options

For cases where you need temporary control over architecture selection:

# Install only x86_64 packages for a specific transaction
yum --exclude=*.i?86 install package

# Alternative syntax using arch specification
yum install package.x86_64

After implementing these changes, verify the behavior with:

# Check what would be installed without actually doing it
yum install --assumeno package

# Inspect installed packages by architecture
rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" | grep i386

Some packages may require 32-bit libraries for compatibility. In these cases, you can:

# Temporarily allow i386 packages for a specific installation
yum --disableexcludes=all install package.i386

# Or whitelist specific packages in yum.conf
[main]
exclude=*.i?86
includepkgs=compat-libstdc++*.i?86

When managing packages on RHEL5 x86_64 systems, you might encounter situations where yum automatically installs both x86_64 and i386 versions of packages when available. This behavior can lead to:

  • Unnecessary disk space consumption
  • Potential library conflicts
  • Increased maintenance complexity

By default, yum on RHEL5 is configured to install packages for all compatible architectures. The package manager follows this order of precedence:

1. Native architecture (x86_64 for 64-bit systems)
2. Compatible architectures (i386 for x86_64 systems)
3. noarch packages

Here are three proven methods to control architecture installations:

Method 1: Yum Configuration File Modification

Edit /etc/yum.conf or create a new file in /etc/yum.conf.d/ with these settings:

[main]
multilib_policy=best
exactarch=1

Method 2: Using Yum Plugin (Recommended for RHEL5)

Install and configure the yum-plugin-priorities package:

yum install yum-plugin-priorities

Then create or modify /etc/yum/pluginconf.d/priorities.conf:

[main]
enabled=1
check_obsoletes=1

Method 3: Command-line Overrides

For one-time installations, you can specify the architecture:

yum install package-name.x86_64

Or use the --setopt parameter:

yum install --setopt=multilib_policy=best package-name

After applying these changes, test with a package known to have both architectures:

yum install zlib

Verify the installed packages:

rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" | grep zlib

If you encounter dependency issues where 32-bit packages are still being installed:

yum deplist package-name | grep i386

For such cases, you may need to explicitly exclude i386 packages:

exclude=*.i386 *.i686

Add this line to your /etc/yum.conf under the [main] section.

Before implementing these changes permanently, consider:

  • Some applications may require 32-bit libraries
  • Third-party software might have architecture-specific dependencies
  • Test changes in a development environment first