I have more than 1400 APT packages installed which specify their architecture as amd64. Around 180 are i386. At least some of the i386 packages have their amd64 counterpart installed as well.
I assumed only amd64 packages would be installed on a 64bit machine. Why do I have some i386 packages installed?
And, for bonus points, how does APT handle dealing with the same package in two architectures? Does it have some way of knowing those exact instances where it must install both?
FYI, I learned all this about the state of installed packages from my APT status file.
The
i386
packages are installed on youramd64
system becausei386
programs cannot useamd64
libraries.This is how
amd64
computers are able to runi386
programs &amd64
programs. If aamd64
program requests forlibxml2
, theamd64
version oflibxml2
will be called. If ani386
program requests forlibxml2
, and it receives theamd64
version, they are not compatible - instead, it receives thei386
version oflibxml2
.So the reason why both
i386
andamd64
packages are installed, is fori386
program support onamd64
systems.All packages on an amd64 Ubuntu installed system are amd64 unless explicitly specified otherwise.
Packages that are listed as
*-i386
are compatibility packages for theamd64
architecture which are usually needed as a dependency for an installed package.This way, you can install a package that is available for the
amd64
architecture (theamd64
version of ani386
package) which is written fori386
without having to "add" this "foreign-architecture
".However, if a package is listed as
*:i386
, it is ani386
package.Certain packages are only available as an i386 version. This seems to be more common with proprietary packages and so wine is often an issue here as we all know how windows won't run a lot of stuff without the x86 (32 bit) directory.
With that said, I believe the i386 foreign architecture is enabled by default on newer versions of Ubuntu.
You can remove the i386 versions of all the packages on your system, although, you should do so with caution as this can cause compatibility issues with applications such as Wine.
Rest assured, however, that Ubuntu and apt will always default to and install the
amd64
version of a package over thei386
version (except for Wine). Typically, you must specify thei386
version and if no arch is specified, the system will almost always install and use theamd64
version if one is available and or installed.