-1

Normally package managers like apt work for X86 and X64 systems.

How does the Linux package manager aptrunning on a Rasberry Pi for example know that the binaries to be fetched and installed must be for the ARM platform?

We simply run sudo apt-get install just like on any other device.

Where is this specified on the device about how to locate the correct packages?

Engineer999
  • 1,111
  • 2
  • 15
  • 32

1 Answers1

1

apt and .deb packages aren’t specific to x86 architectures; Debian in particular supports many different architectures, including arm64, armel and armhf.

On Debian-based systems, including Raspberry Pi OS, the system architecture is defined as the architecture of the dpkg package, and is shown by

dpkg --print-architecture

This is typically set by whatever installation image was used (which has to be appropriate for the system in use), but it can be changed after installation by cross-grading (e.g. i386 to amd64).

apt installs packages for the dpkg-determined architecture by default.

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
  • Thanks for your reply. Are dkpg packages also used for an ARM device? This i am not sure about – Engineer999 Nov 22 '22 at 08:45
  • `.deb` packages are used on Debian derivatives on any supported architecture; on Debian, that includes [`arm64`, `armel` and `armhf`](https://www.debian.org/distrib/netinst) among many others. – Stephen Kitt Nov 22 '22 at 08:49
  • But the Rasberry Pi doesn't use Debian. So how does this work? – Engineer999 Nov 22 '22 at 08:56
  • “Debian-based”. Raspberry Pi OS is Debian-based, *i.e.* it’s a Debian derivative. – Stephen Kitt Nov 22 '22 at 09:00
  • How then would we get a package management system working for Linux which is not a Debian derivative. If we generated the system using Yocto for example. – Engineer999 Nov 22 '22 at 12:47
  • That’s a completely different question. You’d use whatever package management system the target system uses, if any; some embedded systems like Yocto don’t use a package management system on the devices themselves, you’re supposed to build an image for the embedded system externally. – Stephen Kitt Nov 22 '22 at 12:49