16

In order to determine whether or not I have a 64bit OS installed, I have tried the following commands. The output of the commands do not tell me immediately if its a 32bit or 64bit OS.

After looking it up, I know armv7 is a 32 bit architecture. But is there a command that can give an immediate response?

$ uname -m
armv7l
$ uname -a
Linux raspberrypi 5.10.11-v7l+ #1399 SMP Thu Jan 28 12:09:48 GMT 2021 armv7l GNU/Linux
$ arch
armv7l
$ dpkg --print-architecture
armhf
Human
  • 339
  • 1
  • 3
  • 11

4 Answers4

23

I believe you can check what bit size Linux kernel is using for LONG type with the following command:

pi@raspberrypi:~ $ getconf LONG_BIT
32

And it might give insight about your OS version :)

vaha
  • 1,290
  • 2
  • 11
  • 20
4

Second word contains 32-bit:

$ file /lib/systemd/systemd
/lib/systemd/systemd: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=59bb62c73a2fa1a741b6f22657fac8d6a0ce049f, stripped
Human
  • 339
  • 1
  • 3
  • 11
2

Enter the command "inxi -f" That should work on most Linux systems. You can also enter "man inxi" for more information. This will only work if the man pages are installed. You can enter "man man" for more information on this command.

Gil
  • 1,288
  • 6
  • 5
2

You can also let the package manager tell you about it:

~ $ dpkg-architecture

(partial) Sample output:

DEB_BUILD_ARCH=armhf
DEB_BUILD_ARCH_ABI=eabihf
DEB_BUILD_ARCH_BITS=32
DEB_BUILD_ARCH_CPU=arm
...