Multi-Arch Support in Debian

To set up multi-arch support, add the following lines to your /etc/apt/sources.list file:


# Add the following lines for multi-arch support:
# This section adds the necessary lines to enable multi-arch support in the /etc/apt/sources.list file.

deb [arch=amd64,armhf] http://ftp.us.debian.org/debian buster main contrib non-free
# This line specifies the architecture (amd64 and armhf) for which packages will be downloaded from the specified URL.

deb-src [arch=amd64,armhf] http://ftp.us.debian.org/debian buster main contrib non-free
# This line specifies the source packages for the specified architectures (amd64 and armhf) from the specified URL.

# The following lines were already present in the sources.list file and do not need to be added again:
deb http://ftp.us.debian.org/debian buster main contrib non-free
deb-src http://ftp.us.debian.org/debian buster main contrib non-free
# These lines specify the main, contrib, and non-free repositories for the buster version of Debian.

This tells APT to fetch packages for both the amd64 and armhf architectures from the Debian Buster repository. To install a package that is available in multiple architectures, use the colon syntax:

# Update the package list and upgrade any outdated packages
$ sudo apt update && sudo apt upgrade -y

# Install the package "foo" for both the amd64 and armhf architectures
# using the colon syntax to specify the architecture
$ sudo apt install foo:amd64 foo:armhf

This will download and install both versions of “foo”. If you only have one architecture installed on your system (like most people), you can still use multi-arch support to download packages for other architectures and store them locally. This is called cross-building, and it’s a handy way to build packages for different platforms without having to set up separate systems or virtual machines.

When using the Android SDK on an amd64 bit platform, you may encounter problems when trying to run build-tools or platform-tools due to missing libraries. To fix this issue, add the following lines:

# Add i386 architecture to dpkg to enable installation of 32-bit libraries
$ dpkg --add-architecture i386
# Update apt package manager to retrieve latest package information
$ apt update
# Install necessary 32-bit libraries for Android SDK on amd64 bit platform
$ apt install libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386

This will add the i386 architecture and install the necessary libraries. When using :any or :native in package dependencies, it’s important to understand their purpose and limitations. The :any annotation indicates that the target package does not matter, while the :native annotation requests a package for the build architecture instead of the host architecture when satisfying cross Build-Depends. However, you cannot use :any or :native in binary package dependencies, as they are only applicable to Build-Depends. If your target package is a python interpreter, it’s best to use :any rather than :native due to dh-python parsing issues.

SICORPS