3

I have a raspberry pi running Ubuntu 20.04.3 LTS. Two different architectures are being returned depending on the command: aarch64 and arm64. Why?

hostnamectl

ubuntu@ubuntu:~$ hostnamectl
   Static hostname: plex
         Icon name: computer
        Machine ID: 5d1b763f15314c999d1b33e60d8d556f
           Boot ID: bdd535b62f134f6a9216543b36deb678
  Operating System: Ubuntu 20.04.3 LTS
            Kernel: Linux 5.4.0-1047-raspi
      Architecture: arm64

uname

ubuntu@ubuntu:~$ uname --all
Linux plex 5.4.0-1047-raspi #52-Ubuntu SMP PREEMPT Wed Nov 24 08:16:38 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

Thank you! (I believe this is causing a problem. Trying to install something and it's looking for aarch64 and not finding it, but I can see there is a version for amd64.

ToddB
  • 131
  • 1
  • 4

1 Answers1

3

aarch64 and arm64 are the very same architecture. Most of the packagers and package manager uses aarch64 name, but when it comes to systemd it uses arm64. You can find more information here:

https://github.com/systemd/systemd/blob/db58f6a9338d30935aa219bec9a8a853cc807756/src/basic/architecture.c

In this code, aarch64 is mapped back to arm64. Arm64 architecture is also used in the standard specifiers' man page (I have no idea which man page it is but here is the code: https://github.com/systemd/systemd/blob/5efbd0bf897a990ebe43d7dc69141d87c404ac9a/man/standard-specifiers.xml).

This page informs you that architectures are listed in the systemd.unit man page. Here you got extract man 5 systemd.unit.

       ConditionArchitecture=
           Check whether the system is running on a specific
           architecture. Takes one of "x86", "x86-64", "ppc", "ppc-le",
           "ppc64", "ppc64-le", "ia64", "parisc", "parisc64", "s390",
           "s390x", "sparc", "sparc64", "mips", "mips-le", "mips64",
           "mips64-le", "alpha", "arm", "arm-be", "arm64", "arm64-be",
           "sh", "sh64", "m68k", "tilegx", "cris", "arc", "arc-be", or
           "native".

           The architecture is determined from the information returned
           by uname(2) and is thus subject to personality(2). Note that
           a Personality= setting in the same unit file has no effect on
           this condition. A special architecture name "native" is
           mapped to the architecture the system manager itself is
           compiled for. The test may be negated by prepending an
           exclamation mark.

From this short investigation, I deduce that systemd uses uname system call that prints aarch64 and changes it to arm64 internally.

Alex Baranowski
  • 1,171
  • 8
  • 15