Skip to main content
Add an RPM variant.
Source Link
Stephen Kitt
  • 480.9k
  • 59
  • 1.2k
  • 1.4k

On Debian and derivatives,

dpkg --print-architecture

will output the primary architecture of the machine it’s run on. This will be armhf on a machine running 32-bit ARM Debian or Ubuntu (or a derivative), arm64 on a machine running 64-bit ARM.

On RPM-based systems,

rpm --eval '%{_arch}'

will output the current architecture name (which may be influenced by other parameters, e.g. --target).

Note that the running architecture may be different from the hardware architecture or even the kernel architecture. It’s possible to run i386 Debian on a 64-bit Intel or AMD CPU, and I believe it’s possible to run armhf on a 64-bit ARM CPU. It’s also possible to have mostly i386 binaries (so the primary architecture is i386) on an amd64 kernel, or even binaries from an entirely different architecture if it’s supported by QEMU (a common use for this is debootstrap chroots used for cross-compiling).

On Debian and derivatives,

dpkg --print-architecture

will output the primary architecture of the machine it’s run on. This will be armhf on a machine running 32-bit ARM Debian or Ubuntu (or a derivative), arm64 on a machine running 64-bit ARM.

Note that the running architecture may be different from the hardware architecture or even the kernel architecture. It’s possible to run i386 Debian on a 64-bit Intel or AMD CPU, and I believe it’s possible to run armhf on a 64-bit ARM CPU. It’s also possible to have mostly i386 binaries (so the primary architecture is i386) on an amd64 kernel, or even binaries from an entirely different architecture if it’s supported by QEMU (a common use for this is debootstrap chroots used for cross-compiling).

On Debian and derivatives,

dpkg --print-architecture

will output the primary architecture of the machine it’s run on. This will be armhf on a machine running 32-bit ARM Debian or Ubuntu (or a derivative), arm64 on a machine running 64-bit ARM.

On RPM-based systems,

rpm --eval '%{_arch}'

will output the current architecture name (which may be influenced by other parameters, e.g. --target).

Note that the running architecture may be different from the hardware architecture or even the kernel architecture. It’s possible to run i386 Debian on a 64-bit Intel or AMD CPU, and I believe it’s possible to run armhf on a 64-bit ARM CPU. It’s also possible to have mostly i386 binaries (so the primary architecture is i386) on an amd64 kernel, or even binaries from an entirely different architecture if it’s supported by QEMU (a common use for this is debootstrap chroots used for cross-compiling).

Typography, mention QEMU.
Source Link
Stephen Kitt
  • 480.9k
  • 59
  • 1.2k
  • 1.4k

On Debian and derivatives,

dpkg --print-architecture

will output the primary architecture of the machine it'sit’s run on. This will be armhf on a machine running 32-bit ARM Debian or Ubuntu (or a derivative), arm64 on a machine running 64-bit ARM.

Note that the running architecture may be different from the hardware architecture or even the kernel architecture. It'sIt’s possible to run i386 Debian on a 64-bit Intel or AMD CPU, and I believe it'sit’s possible to run armhf on a 64-bit ARM CPU. It's evenIt’s also possible to have mostly i386 binaries (so the primary architecture is i386) on an amd64 kernel.., or even binaries from an entirely different architecture if it’s supported by QEMU (a common use for this is debootstrap chroots used for cross-compiling).

On Debian and derivatives,

dpkg --print-architecture

will output the primary architecture of the machine it's run on. This will be armhf on a machine running 32-bit ARM Debian or Ubuntu (or a derivative), arm64 on a machine running 64-bit ARM.

Note that the running architecture may be different from the hardware architecture or even the kernel architecture. It's possible to run i386 Debian on a 64-bit Intel or AMD CPU, and I believe it's possible to run armhf on a 64-bit ARM CPU. It's even possible to have mostly i386 binaries (so the primary architecture is i386) on an amd64 kernel...

On Debian and derivatives,

dpkg --print-architecture

will output the primary architecture of the machine it’s run on. This will be armhf on a machine running 32-bit ARM Debian or Ubuntu (or a derivative), arm64 on a machine running 64-bit ARM.

Note that the running architecture may be different from the hardware architecture or even the kernel architecture. It’s possible to run i386 Debian on a 64-bit Intel or AMD CPU, and I believe it’s possible to run armhf on a 64-bit ARM CPU. It’s also possible to have mostly i386 binaries (so the primary architecture is i386) on an amd64 kernel, or even binaries from an entirely different architecture if it’s supported by QEMU (a common use for this is debootstrap chroots used for cross-compiling).

Clarify that this is only for Debian and derivatives.
Source Link
Stephen Kitt
  • 480.9k
  • 59
  • 1.2k
  • 1.4k

On Debian and derivatives,

dpkg --print-architecture

will output the primary architecture of the machine it's run on. This will be armhf on a machine running 32-bit ARM Debian or Ubuntu (or a derivative), arm64 on a machine running 64-bit ARM.

Note that the running architecture may be different from the hardware architecture or even the kernel architecture. It's possible to run i386 Debian on a 64-bit Intel or AMD CPU, and I believe it's possible to run armhf on a 64-bit ARM CPU. It's even possible to have mostly i386 binaries (so the primary architecture is i386) on an amd64 kernel...

dpkg --print-architecture

will output the primary architecture of the machine it's run on. This will be armhf on a machine running 32-bit ARM Debian or Ubuntu (or a derivative), arm64 on a machine running 64-bit ARM.

Note that the running architecture may be different from the hardware architecture or even the kernel architecture. It's possible to run i386 Debian on a 64-bit Intel or AMD CPU, and I believe it's possible to run armhf on a 64-bit ARM CPU. It's even possible to have mostly i386 binaries (so the primary architecture is i386) on an amd64 kernel...

On Debian and derivatives,

dpkg --print-architecture

will output the primary architecture of the machine it's run on. This will be armhf on a machine running 32-bit ARM Debian or Ubuntu (or a derivative), arm64 on a machine running 64-bit ARM.

Note that the running architecture may be different from the hardware architecture or even the kernel architecture. It's possible to run i386 Debian on a 64-bit Intel or AMD CPU, and I believe it's possible to run armhf on a 64-bit ARM CPU. It's even possible to have mostly i386 binaries (so the primary architecture is i386) on an amd64 kernel...

Source Link
Stephen Kitt
  • 480.9k
  • 59
  • 1.2k
  • 1.4k
Loading