Maybe aarch64-linux-gnu-gcc is not installed. Try

sudo apt-get install gcc-aarch64-linux-gnu
Answer from user7305360 on Stack Overflow
🌐
Toradex Community
community.toradex.com › technical support
Aarch64-none-linux-gnu-gcc: not found - Technical Support - Toradex Community
July 11, 2024 - Hi, i am using colibri-imx6ull SOM and trying to create the costume linux by using “Build U-Boot From Source Code | Toradex Developer Center” right now i am in the phase of host image creation in host device, while i am trying to follow the same i am facing the following issue lcl@lcl-Latitude-5430:~/workdir/u-boot$ make mrproper /bin/sh: 1: aarch64-none-linux-gnu-gcc: not found make: aarch64-none-linux-gnu-gcc: No such file or directory /bin/sh: 1: aarch64-none-linux-gnu-gcc: not found ...
🌐
GitHub
github.com › tensorchord › pgvecto.rs › issues › 190
aarch64 build error: linker `aarch64-linux-gnu-gcc` not found · Issue #190 · tensorchord/pgvecto.rs
December 17, 2023 - Using PgConfig("pg15") and `pg_config` from /usr/bin/pg_config Building extension with features pg15 Running command "/home/alarm/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/bin/cargo" "build" "--release" "--features" "pg15" "--no-default-features" "--message-format=json-render-diagnostics" Compiling proc-macro2 v1.0.70 Compiling libc v0.2.151 Compiling serde v1.0.193 Compiling syn v1.0.109 error: linker `aarch64-linux-gnu-gcc` not found | = note: No such file or directory (os error 2) error: could not compile `serde` (build script) due to previous error warning: build failed, waiting for other jobs to finish...
Author   ahpohl
🌐
Linux Man Pages
linux.die.net › man › 1 › aarch64-linux-gnu-gcc
aarch64-linux-gnu-gcc(1) - Linux man page
The option -fno-gnu89-inline explicitly tells GCC to use the C99 semantics for "inline" when in C99 or gnu99 mode (i.e., it specifies the default behavior). This option was first supported in GCC 4.3. This option is not supported in -std=c90 or -std=gnu90 mode.
🌐
GitHub
github.com › openssl › openssl › issues › 14221
aarch64-linux-gnu-gccranlib: not found · Issue #14221 · openssl/openssl
./Configure linux-elf no-asm shared --prefix=/usr --openssldir=ssl --cross-compile-prefix=aarch64-linux-gnu-gcc
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › 64920256 › aarch64-linux-gnu-g-cross-compiling-to-arm64-error
gcc - aarch64-linux-gnu-g++ cross compiling to arm64 error - Stack Overflow
Probably you need to install glibc-aarch64-linux-gnu-2.24-2.sdl7.2.noarch.rpm andglibc-aarch64-linux-gnu-devel-2.24-2.sdl7.2.noarch.rpm. sys/socket.h is present in the second package. As far as I know, there is no rpm package available directly with the headers of libstdc ++ for centos 7. One solution would be to cross compile libstd ++ directly from source. ... Sign up to request clarification or add additional context in comments. ... I tried to install glibc-headers-2.17-317.el7.aarch64.rpm but it failed as it is the wrong arch type on my development machine which is x86 running centos.
🌐
GitHub
github.com › flathub › org.freedesktop.Sdk.Extension.rust-stable › issues › 118
error: linker `aarch64-linux-gnu-gcc` not found · Issue #118 · flathub/org.freedesktop.Sdk.Extension.rust-stable
March 3, 2022 - Is there any specific configuration needed to build on aarch64? Looking at the manifest, I get the impression that a aarch64 linker is already in place. Full error log here: https://flathub.org/bui...
Author   olof-nord
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
I can't cross compile to aarch64-linux-gnu with clang / Programming & Scripting / Arch Linux Forums
July 28, 2021 - "/usr/bin/aarch64-linux-gnu-ld" ... /usr/bin/../lib64/gcc/aarch64-linux-gnu/11.1.0/../../../../lib64/Scrt1.o: error adding symbols: file in wrong format clang-12: error: linker command failed with exit code 1 (use -v to see invocation) ... Please edit your posts and use [ code ] tags (not quote tags) ...
🌐
Debian
packages.debian.org › sid › gcc-aarch64-linux-gnu
Debian -- Details of package gcc-aarch64-linux-gnu in sid
dep: gcc-15-aarch64-linux-gnu (>= 15.2.0-2~) GNU C compiler for the aarch64-linux-gnu architecture · rec: libc-dev [arm64] Package not available · rec: libc6-dev [arm64] GNU C Library: Development Libraries and Header Files also a virtual package provided by libc6.1-dev ·
🌐
Arch Linux
archlinux.org › packages › extra › x86_64 › aarch64-linux-gnu-gcc
Arch Linux - aarch64-linux-gnu-gcc 15.2.0-1 (x86_64)
View the file list for aarch64-linux-gnu-gcc · View the soname list for aarch64-linux-gnu-gcc
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › bare metal, assembly language
gcc-aarch64-linux-gnu on a RP4 - Raspberry Pi Forums
The following packages have unmet dependencies: crossbuild-essential-arm64 : Depends: gcc-aarch64-linux-gnu (>= 4:8.3) but it is not installable or gcc:arm64 but it is not installable Depends: g++-aarch64-linux-gnu (>= 4:8.3) but it is not installable or g++:arm64 but it is not installable ...
🌐
Arch Linux
bugs.archlinux.org › task › 70688
FS#70688 : [aarch64-linux-gnu-gcc] Can't link a simple C program using custom --sysroot
I found this bug after I filed · FS#76279 . gcc correctly find /usr/aarch64-linux-gnu/lib/libc.so. But the file is an ld script that points to /lib/libc.so.6. If you manually modify the script to point to /usr/aarch64-linux-gnu/lib/libc.so.6, it will work. For comparison, /usr/aarch64-linux-gnu/lib/libc.so points to /usr/aarch64-linux-gnu/lib/libc.so.6 on Debian. Comment by Chia-I Wu (olv) - Monday, 24 October 2022, 00:12 GMT · By the way, notice how "--with-sysroot" differs on Arch and Ubuntu.
🌐
Medium
medium.com › geekculture › error-command-usr-bin-aarch64-linux-gnu-gcc-failed-with-exit-code-1-36dfac6c72d6
error: command ‘/usr/bin/aarch64-linux-gnu-gcc’ failed with exit code 1 - Geek Culture - Medium
October 14, 2022 - error: command ‘/usr/bin/aarch64-linux-gnu-gcc’ failed with exit code 1 · ~ #include <Python.h> ^~~~~~~~~~ compilation terminated. ~ ~ legacy-install-failure ~ You need Python header files. You can solve the problem by installing pythonx.x-dev with apt-get. (replace x.x with the python version you are using) sudo apt-get install python3.8-dev · After that, it will be installed without issues. Note: If it is not Python3, python-dev seems to be the way to go.
Top answer
1 of 1
10

The recommended way

Ubuntu 23.04 has both the packages you seem to need and in the versions that you require i.e. gcc-13 and gcc-13-aarch64-linux-gnu in the [security] [universe] repository and Ubuntu 23.10 has them in the [main] repository ... So, my advice would, naturally, be to upgrade your system to Ubuntu 23.04 or even 23.10 and then install your desired packages like so:

sudo apt update && sudo apt install gcc-13 gcc-13-aarch64-linux-gnu

That is the recommended and safest way.

The hacky way

Otherwise, it's the on your own risk way ... e.g. adding a PPA such as you did ... Yep, you have already chosen the "on your own risk way" ... Read this (emphasis is mine):

Adding this PPA to your system

You can update your system with unsupported packages from this untrusted PPA by adding ppa:ubuntu... to your system's Software Sources.

... that text is quoted from the Launchpad link you included in your question and it's not limited to that specific PPA (which might be of good reputation), but it is what it is.

That PPA enables for installing the package gcc-13 on Ubuntu 22.04 by essentially including that package with its dependencies that can not be satisfied from the Ubuntu 22.04 official repositories and of course some other work might be involved like modifying post-install and/or pre-install scripts and ensuring none of the added package or its dependencies will conflict with existing essential system packages and so forth.

In the case of gcc-13 and gcc-13-aarch64-linux-gnu, which are also made available in Ubuntu 23.04/23.10 official repositories, one might ponder the possibility of installing them from 23.04/23.10 repositories on an Ubuntu 22.04 system? ... Well, yeah surely possible (for these two) and it should make the "on your own risk" zone a bit more appealing as those repositories are official and trusted, but the unsupported part will still apply.

Anyway, I have quickly traced those two packages and their dependencies and then installed both from the official repositories of Ubuntu 23.10 on an Ubuntu 22.04 system successfully without any noticeable drawbacks AFAIK ... After all the GNU C compiler is not essential to the functionality of Ubuntu and is offered as an optional package for manual install.

However, there is probably most likely certainly an extremely big problem awaiting if you're not careful enough i.e. you must make sure no other packages from that repository get installed by any means including automatic-updates so turn all those off and fully update your system first, then follow all instructions precisely (still on your own risk of course) ... If other packages got installed, they might break your system so dangerously badly and possible beyond any applicable repair and of course this is as unsupported as your PPA installed packages ... So, we will not provide any support for either.

Needless to say that I don't prefer it or like it this way, but you seem to need it so I wrote it.

The idea is, basically, to add the official Ubuntu repository containing those two packages, refresh the local cached sources list, install those two packages and promptly delete the added repository from you system like so:

First, add the repository:

echo "deb http://cz.archive.ubuntu.com/ubuntu mantic main" |
sudo tee /etc/apt/sources.list.d/temporary-repository.list

Second, update package lists:

sudo apt update

Third, only install gcc-13 and gcc-13-aarch64-linux-gnu:

sudo apt install gcc-13 gcc-13-aarch64-linux-gnu

Fourth, delete that temporary repository:

sudo rm /etc/apt/sources.list.d/temporary-repository.list

Finally, update your cached packages lists:

sudo apt update

Notice

  • You might need to first remove the gcc-13 package you have already installed from that PPA and the PPA itself to avoid possible dependency version mismatch.

  • You'll need to run those by version number i.e. gcc-13 -v and aarch64-linux-gnu-gcc-13 -v and not just gcc or you can use the Ubuntu alternatives system to choose the default version.