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


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

Multiarch lets you install packages from different architectures to the one your system normally uses. For example, you can use it to install an old i386 package on a modern x86_64 PC. Note that library packages (i.e. packages that install files in /usr/lib) are usually designed to let you install versions designed for multiple architectures at once, but application packages (i.e. packages that install files in locations like /usr/bin) usually do not: you will usually need to uninstall applications designed for one architecture before installing a version designed 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 applications installed on an x86_64 PC using multiarch should run without further configuration). But you will probably need to use QEMU user emulation to run binaries for a completely different architecture (e.g. armhf applications 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