TL,DR: if you're only offered a choice of “32-bit” and “64-bit”, neither is right for a Raspberry Pi (or any other ARM-based computer). You need a package for ARM, and the right one to boot, which is armhf
.
“32-bit” and “64-bit” are only one of the characteristics of a processor architecture. Many processor families come in both 32-bit and 64-bit variants (x86, ARM, Sparc, PPC, MIPS, …). Debian alone has 23 official binary distributions for different processor characteristics and different software characteristics.
You need to install a package which matches the ABI for your system. The ABI (application binary interface) includes the processor type (more precisely, its instruction set), but also other characteristics related to the ways programs interact. In particular, when a program makes a call to code that is in a library, the ABI determines how the arguments to the library function are passed (in registers or on the stack).
In the PC world, there are two instruction sets (up to minor variations that do not matter):
- IA-32, a variant of x86, commonly known as i386 (the name used by Debian) or i686 (which, like IA-32, are generations of the x86 architecture series);
- x86-64, also known as x64 or amd64 (the name used by Debian) (not to be confused with IA-64 which is completely different).
Both Intel and AMD make processors that implement the x86 and x86-64 instruction sets. Modern PCs have processors that support both the x86-64 and the x86 instruction sets; older PCs have processors that support only x86. Because the x86 instruction set uses 32-bit registers and the x86-64 instruction set uses 64-bit registers, and because for each instruction set there is a single ABI used by all Linux installations¹, these are often described as just “32-bit” or “64-bit”. In a PC context, “32-bit” means “x86” and “64-bit” means “x86-64”.
ARM processors have a completely different instruction set. You cannot install an x86 or x86-64 package on an ARM system. You need a package for ARM, for the correct instruction set, and more generally for the correct ABI. There are no major 64-bit distributions for 64-bit ARM processors yet, because the ARMv8 architecture revision which introduces a 64-bit instruction set is still very new and not commonly available. There are however multiple 32-bit ABIs, which assume the existence of different processor features and use different versions of the argument-passing convention. The main ARM ABIs used on Linux are:
- armel, based on the ARM EABI version 2 (known as “ARM EABI” or “EABI” for short), in its little-endian incarnation;
- armhf, which is a variant of armel that takes advantage of some features of newer ARM CPUs, in particular hardware floating-point support.
All devices that support armhf also support armel; however a given system installation must be consistent. Raspbian uses armhf (in fact, it started out as a port of Debian's armel to armhf, back when armhf was a new thing).
¹ At least for mainstream distributions. There are embedded distributions that have several x86 binary releases, with packages compiled against different versions of the standard C library (glibc, dietlibc, uclibc, …).
Best Answer
There are several gradations, since you can run a 32-bit or mixed operating system on a 64-bit-capable CPU. See 64-bit kernel, but all 32-bit ELF executable running processes, how is this? for a detailed discussion (written for x86, but most of it applies to arm as well).
You can find the processor model in
/proc/cpuinfo
. For example:ARMv7 (and below) is 32-bit. ARMv8 introduces the 64-bit instruction set.
If you want to see whether your system supports 64-bit binaries, check the kernel architecture:
On a 64-bit processor, you'd see a string starting with
armv8
(or above) if theuname
process itself is a 32-bit process, oraarch64
if it's a 64-bit process. (See also https://stackoverflow.com/questions/45125516/possible-values-for-uname-m)