Translation(s): English - Español - Français - Português (Brasil) - Русский


This page discusses how to use multiarch packages. For other multiarch topics, see the multiarch category. Or for information about running binaries from incompatible architectures, see QemuUserEmulation.

Multiarch lets you install packages for different architectures than your system normally uses, e.g. an old i386 package on a modern x86_64 PC. Note that library packages (i.e. packages that populate /usr/lib) are usually designed to let you install multiple architectures at once, but application packages (i.e. packages that populate /usr/bin etc.) will usually need to be uninstalled for one architecture before being installed for another.

Once you have installed a multiarch application, you should be able to run it straight away if it was compiled for a predecessor of your hardware architecture (e.g. i386 binaries on an x86_64 PC). But you will probably need to configure QEMU user emulation to run binaries for a completely different architecture (e.g. armhf on x86_64). If you want to run binaries for a different operating system (e.g. FreeBSD binaries on Linux), see QEMU instead.

/!\ This page uses the term "architecture" to refer to a Debian architecture name, other pages may use the same word to mean "multiarch name"

Basic usage

See currently available architectures

# Your system's architecture:
dpkg --print-architecture
# Other architectures:
dpkg --print-foreign-architectures

Add another architecture

# e.g. "i386":
sudo dpkg --add-architecture "<architecture>"
sudo apt-get update

Install a package for a specific architecture

# e.g. "libc6:i386":
sudo apt-get install "<package>:<architecture>"

Remove an architecture

# Uninstall packages:
sudo apt-get purge ".*:<architecture>"
# Remove configuration:
sudo dpkg --remove-architecture "<architecture>"

Advanced usage

Highlight a package's Multi-Arch header

Some packages have a Multi-Arch header that specifies their multi-arch behaviour. For more information, see the multiarch specification.

apt-cache show "<package-name>" | grep --color "^\|^Multi-Arch: "

Set architecture for specific apt sources

Sometimes, it can be useful to specify a different architecture for one particular APT repository. For example, you might want to add a repository that doesn't support your native architecture at all.

Add [arch=arch1,arch2,...] to all appropriate /etc/apt/sources.d lines:

deb http://supports-all-architectures.example.com/ stable main
deb [arch=amd64,i386] http://intel-only.example.com/ stable main
deb [arch=armel,armhf] http://arm-only.example.com/ stable main

# No need to arch-qualify source repositories:
#deb-src http://supports-all-architectures.example.com/ stable main
#deb-src http://intel-only.example.com/ stable main
#deb-src http://arm-only.example.com/ stable main

Remember to sudo apt-get update after editing the list of repositories.

Change the default apt architecture

When you don't specify an architecture, apt normally defaults to using the architecture it was compiled for. If you want a different behaviour for some reason, see APT::Architecture in apt.conf.

Install cross-dependencies

To install build-dependencies of a package before cross-compiling:

sudo apt-get build-dep -a "<architecture>" "<package>"

This assumes package's dependencies have proper Multi-Arch headers (see Multiarch/Implementation for details). If not, you should be able to manually apt-get install individual dependencies for either your native architecture or your target architecture. See also MultiarchCross.

Install Android SDK compat libraries

If you use the Android SDK and have problems running build-tools or platform-tools on x86_64:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386

Report multi-arch bugs

If you find a multiarch-related bug in a Debian package, make sure your bug report contains User and Usertags lines like this:

Package: <name>
Version: <version>
Severity: <severity>
User: multiarch-devel@lists.alioth.debian.org
Usertags: multiarch

...

To see existing multiarch bugs, see bugs tagged multiarch. For more information about tagging bugs, see usertags and assigning tags to bugs.


CategoryPermalink CategorySystemAdministration CategoryPackageManagement CategoryMultiarch