6

Pretty self-explanatory: could someone tell me why I get the error

$ sudo apt-get install gcc-6-base:arm64
dpkg: error processing archive /var/cache/apt/archives/gcc-6-base_6.0.1-0ubuntu1_arm64.deb (--unpack):
 package architecture (arm64) does not match system (amd64)
Errors were encountered while processing:
 /var/cache/apt/archives/gcc-6-base_6.0.1-0ubuntu1_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

when

$ sudo apt-get install gcc-6-base:armhf
Selecting previously unselected package gcc-6-base:armhf.
(Reading database ... 219445 files and directories currently installed.)
Preparing to unpack .../gcc-6-base_6.0.1-0ubuntu1_armhf.deb ...
Unpacking gcc-6-base:armhf (6.0.1-0ubuntu1) ...
Setting up gcc-6-base:armhf (6.0.1-0ubuntu1) ...

works just fine on my AMD64 system? How do I fix this?

user541686
  • 4,097
  • 10
  • 34
  • 49

1 Answers1

12

Never mind, I figured it out. You need to run:

sudo dpkg --add-architecture arm64

And you can see the list of existing architectures added via:

sudo dpkg --print-foreign-architectures

Why they think the user must be initially joking about the explicit :arm64 suffix is beyond me. It's not like you don't already have to explicilty add arm64 as an architecture in /etc/sources.list...

user541686
  • 4,097
  • 10
  • 34
  • 49
  • How do you explicitly add `arm64` as an architecture in `/etc/apt/sources.list`? Or in my case, `amd64`? I have tried both `sudo dpkg --add-architecture amd64` and modifying `/etc/apt/sources.list` with lines starting with `deb [arch=arm64,amd64] http://us.ports` but apt is not able to find amd64 packages. – Aaron Franke Aug 28 '22 at 04:10
  • @AaronFranke: Unfortunately I don't know; you might want to ask a separate question. – user541686 Aug 28 '22 at 04:56