How to install different architecture binaries on Linux

by Marion Bates <mbates at whoopis.com>

Last modified: April 19 2005 14:15:28

Background: Server running Fedora Core 3 x86 64bit Linux.

Problem: Needed to install an i386 RPM (in this case, the Retrospect Remote client for Linux). When I tried, it complained:

[username@host ~]$ sudo rpm -Uvh retroclient-65.rpm 
Password:
error: Failed dependencies:
        libglib-1.2.so.0 is needed by retroclient-6.5.108-1.i386
        libgthread-1.2.so.0 is needed by retroclient-6.5.108-1.i386
That file is there, of course, but only in the /usr/lib64/ path:
[username@host ~]$ locate libglib-1.2
/usr/lib64/libglib-1.2.so.0
/usr/lib64/libglib-1.2.so.0.0.10
To find out which package it came from:
[username@host ~]$ rpm -qf /usr/lib64/libglib-1.2.so.0
glib-1.2.10-15

See the Unix man pages for rpm here. Solution: Install the 32-bit version alongside the 64-bit one. How did we know that would be ok? Well, because George and Bill both said so; but I have read that you can see what emulations are supported on your system by running ld:
[username@host ~]$ ld --verbose
GNU ld version 2.15.92.0.2 20040927
  Supported emulations:
   elf_x86_64
   elf_i386
   i386linux
...

See the Unix man pages for ld here.

We already had yum set up on this machine, and yum lets you specify a package's architecture (if multiple choices are available) when you ask to install it.

[username@host ~]$ yum search glib
...
glib.x86_64                              1:1.2.10-15            installed   
...
glibc.i686                               2.3.3-74               [some repository]
...

See the Unix man pages for yum here. If you're not seeing enough choices, add some repositories to your yum.conf. For example:
[username@host ~]$ wget http://ford.stearns.org/fedora/yum.conf.addme
[username@host ~]$ cat yum.conf.addme > yum.conf

See the Unix man pages for wget here. Then edit yum.conf, add "gpgcheck=0" in top section AND comment out all three lines of the "atrpms" section, if it's there; reason being that this repository has a Python version mismatch and can cause yum itself to break. If that happens anyway, and you get Python errors when you try to run yum, then remove it and replace it with a version original to your distro:
[username@host ~]$ rpm -e yum-2.1.12-0.fc3 yum-2.1.12-48.rhfc3.at
[username@host ~]$ rpm -Uvh http://ford.stearns.org/fedora/linux/3/x86_64/updates/packages/yum-2.1.12-0.fc3.noarch.rpm
[username@host ~]$ cat yum.conf.rpmsave > yum.conf

You need yum version 2.1.12 or better; 2.1.11 has a bug that won't let you install a package with a different architecture alongside another one.

[username@host ~]$ yum --version
to find out. If yours is old, do
[username@host ~]$ yum check-update
[username@host ~]$ yum update yum
If it still whines about the GPG thing, do:
[username@host ~]$ rpm --import http://atrpms.net/RPM-GPG-KEY.atrpms
and update again.

When yum is up to date and working, install the package:

[username@host ~]$ yum install glib.i386


Get Euro-style oval stickers for Geeks!

NEW -- the "magic/more magic" light switch cover!
Click here for the story.

References: