Can apt-get/synaptic handle 2 arches on amd64?

James Wilkinson ubuntu at westexe.demon.co.uk
Wed Apr 27 16:44:00 UTC 2005


Alexander Volovics wrote:
> How does ubuntu/debian deal with the problem of different arches
> on amd64 installs?
> Some programs/utilities/codecs still only exist for i386.
> They can run under x86_64 but can they be installed easily?

Hi Alexander! Nice to see a familiar name from the Fedora list.

For those listening at home, the problem is that 32 bit binaries need 32
bit libraries, while 64 bit binaries need 64 bit libraries. So if you're
going to have both on the system, you need both a 32 bit and a 64 bit
version of glibc installed.

Potentially, you may need 32 bit and 64 bit versions of any library on
the system.

Fedora / Red Hat deals with the problem by allowing both i386 and x86_64
RPMs to be installed at the same time. 64 bit libs go in lib64 (/lib64,
/usr/lib/64, or /usr/local/lib64), 32 bit libs go in lib, 64 bit
executables are preferred to 32 bit executables, and other files are
allowed to be shared if they are otherwise identical.

So it follows that practically, you need to build both 32 bit and 64 bit
RPMs from the same source RPM, and upgrade them together.

The system works remarkably well as long as you don't un-install *one*
of the RPMs without reinstalling the other. If you just uninstall (say)
the 32 bit glibc, a lot of the shared files will go missing until you
reinstall the 64 bit glibc: one upshot is that localisation stops
working.

Ubuntu, on the other hand, takes the Debian approach. The system is
inherently 64 bit, and 32 bit compatibility is handled by add-on
packages. This has the benefit that you don't have shared files. It has
the disadvantage that the library packages need to be explicitly built
for "32 bit on 64 bit".

This *mostly* works. It doesn't work for everything (at least, I can't
get RealPlayer to work. This is almost certainly due to missing
libraries: I just haven't found out which ones...)

The other alternative is to have another, fairly minimal, 32 bit install
around, install the 32 bit package into there, and use chroot or
dchroot. I can get RealPlayer to work that way (although I'm still using
my old Fedora install).

chroot and co make a process pretend that, say /fedora is /, and
calculate everything appropriately. So /fedora/usr/bin/yum would think
it was /usr/bin/yum, and look for /bin/rpm in /fedora/bin/rpm .

See
http://www.ubuntulinux.org/wiki/DebootstrapChroot/view?searchterm=dchroot
or the end of http://digital-conquest.ath.cx/wiki/index.php/Ubuntu for
more details: much of the necessary set-up is automated.

The Debian howto is found here:
https://alioth.debian.org/docman/view.php/30192/21/debian-amd64-howto.html

In the long term, Debian are planning a multiarch setup, where you'll be
able to have binaries from umpteen different architectures installed at
the same time, and the system will do the Right Thing. This is some way
off.

James.
-- 
E-mail address: james | Blessed are the pessimistic, for they take backups.
@westexe.demon.co.uk  | 




More information about the ubuntu-users mailing list