Check Whether Raspberry Pi OS is 32-bit or 64-bit

Check Whether Raspberry Pi OS is 32-bit or 64-bit

Raspberry Pi OS is available in a 32-bit and 64-bit architecture. When installing applications, it is important to know whether the operating system is 32-bit or 64-bit. This tutorial shows how to check whether Raspberry Pi OS is 32-bit or 64-bit.

The getconf is a command line tool that is used to retrieve system configuration information at runtime. Using the getconf command with the LONG_BIT option, prints the number of bits in a long integer data type on the system.

getconf LONG_BIT

If the command outputs the 32, then OS is 32-bit and if it outputs the 64, then OS is 64-bit.

Note: uname -m command can be used to determine if Linux kernel is 32-bit or 64-bit. A 32-bit OS can use a 32-bit or 64-bit kernel. After Linux kernel update to 6.1 on Raspberry Pi OS, the 64-bit Linux kernel is used by default, even on the 32-bit OS. In that case, uname -m returning aarch64 instead of armv7l.

The 4 Comments Found

  1. Avatar
    Charlie Reply

    trying to get 32 bit rpi desktop running under hyper v. Downloaded and installed RPI desktop 32 bit. uname -m says x86_64. So am I running a 32 bit (what I want) or a 64 bit Raspian?

    • Avatar
      lindevs Reply

      When running Raspberry Pi OS under Hyper-V, the output of uname -m command may not accurately reflect the underlying architecture of the Raspberry Pi OS due to the virtualization layer. Currently, I'm unable to test your scenario. I recommended checking the contents of the /proc/cpuinfo file. Maybe it allows indicating the actual architecture of the Raspberry Pi OS.

  2. Avatar
    sean Reply

    uname only tells you if the kernel is 32 or 64 bit, you can use a 64 bit kernel with 32-bit userspace.

    • Avatar
      lindevs Reply

      Yes, you are correct. With the latest Raspberry Pi OS upgrades, the 64-bit kernel is used by default, even on the 32-bit OS. I updated the post regarding this.

Leave a Comment

Cancel reply

Your email address will not be published.