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.

Answer from Raffa on askubuntu.com
🌐
SUSE
documentation.suse.com › sles › 12-SP5 › html › SLES-all › cha-aarch64.html
Installation on Arm AArch64 | Deployment Guide | SLES 12 SP5
April 8, 2026 - This chapter describes the steps necessary to prepare for the installation of SUSE Linux Enterprise Server on Arm AArch64 computers. It introduces the steps required to prepare for various installation methods. The list of hardware requirements provides an overview of systems supported by SUSE Linux Enterprise Server.
🌐
GitHub
github.com › kwankiu › archlinux-installer
GitHub - kwankiu/archlinux-installer: a community-built Arch Linux Installer for ARM (Aarch64) based devices. · GitHub
a community-built Arch Linux Installer for ARM (Aarch64) based devices. - kwankiu/archlinux-installer
Starred by 194 users
Forked by 19 users
Languages   Shell
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.

🌐
SUSE
documentation.suse.com › sles › 12-SP4 › html › SLES-all › cha-aarch64.html
SUSE - Open Source Solutions for Enterprise Servers & Cloud
Modernize your infrastructure with SUSE Linux Enterprise servers, cloud technology for IaaS, and SUSE's software-defined storage.
Top answer
1 of 2
10

As of Ubuntu 18.04 you can do:

sudo apt-get install gcc-aarch64-linux-gnu
aarch64-linux-gnu-gcc -mcpu=cortex-a53 hello_world.c

The package gcc-aarch64-linux-gnu is at version 4:7.3.0-3ubuntu2

However, for Raspberry Pi, you should just download the official binaries from https://github.com/raspberrypi/tools which is the more reliable way to do it as explained at: https://raspberrypi.stackexchange.com/questions/64273/installing-raspberry-pi-cross-compiler/83215#83215

Finally, for bare metal, I was not able to find the analogue of arm-none-eabi-gcc, I wonder why: https://github.com/cirosantilli/cirosantilli.github.io/issues/68

2 of 2
2

You can try my Latest Pre-Built Open-Sourced GCC Toolchains for Raspberry Pi from this Github Project:

This Project Summary: This project contains the UpToDate set of Precompiled/Pre-Built Raspberry pi GCC Cross & Native Compilers Binaries, saving your tons of time(No compiling or Error Handling needed whatsoever). Just Extract, Link & Enjoy complete GCC(Raspberry Pi) functionality in your Machine. You can use its native compilers for Raspberry Pi(Can be used along with old & slow 6.3.0 GCC), Or use the Cross-Compiler in any Linux Machine(Tested on Latest Ubuntu/bionic x64) to compile programs for your Raspberry Pi. All these compilers binaries are Raspberry Pi hardware optimized for enhanced overall performance.

The Supported GCC Versions are:

  • GCC 6.3.0
  • GCC 7.4.0
  • GCC 8.2.0
  • GCC 8.3.0

Supported Environments:

  • Cross-Compiler: All Linux Distros (x32/x64) are currently supported.
  • Native-Compiler: All Raspberry Pi version/model with Raspbian OS is supported. Other OS may/may-not work.

Hope that helps! :)

🌐
OneUptime
oneuptime.com › home › blog › how to install ubuntu server on an arm64 (aarch64) machine
How to Install Ubuntu Server on an ARM64 (AArch64) Machine
March 2, 2026 - # Install cross-architecture QEMU sudo apt install qemu-system-arm # Boot the ARM64 Ubuntu installer qemu-system-aarch64 \ -machine virt \ -cpu cortex-a72 \ -smp 2 \ -m 2048 \ -drive if=pflash,format=raw,file=/usr/share/AAVMF/AAVMF_CODE.fd,...
Find elsewhere
🌐
Xpack-dev-tools
xpack-dev-tools.github.io › installation guide
Installation Guide | xPack GNU AArch64 Embedded GCC
With all binary tools installed within xpacks/.bin, the project build configurations require only a single PATH adjustment: export PATH=<...project-path...>/xpacks/.bin:$PATH ... identify the platform-specific archive for the desired version of @xpack-dev-tools/aarch64-none-elf-gcc, download it into a cache and unpack it into a versioned folder within the user's global xPacks store (if not already present); check the output of the xpm install command for the actual folder used on your platform;
🌐
GraalVM
graalvm.org › 22.1 › docs › getting-started › linux-aarch64
Installation on Linux ARM64 systems
As of version 21.0, we provide GraalVM Community Edition for Linux on ARM 64-bit system, based on OpenJDK 11 and OpenJDK 17 for AArch64 architecture. This distribution can be installed on Linux systems for AArch64 CPU architecture.
🌐
Fedora Project
fedoraproject.org › wiki › Architectures › AArch64 › Install_with_QEMU
Architectures/AArch64/Install with QEMU - Fedora Project Wiki
sudo virt-install \ --name f33-aarch64 --ram 4096 --arch aarch64 \ --boot uefi --disk size=8 \ --location https://download.fedoraproject.org/pub/fedora/linux/releases/33/Server/aarch64/os/
🌐
Arch Linux ARM
archlinuxarm.org › packages › aarch64 › linux-aarch64
linux-aarch64 (aarch64) | Packages | Arch Linux ARM
Copyright ©2009-2026 Arch Linux ARM The registered trademark Linux® is used pursuant to a sublicense from LMI, the exclusive licensee of Linus Torvalds, owner of the mark on a world-wide basis. The Arch Linux™ name and logo are used under permission of the Arch Linux Project Lead
🌐
Slackware
arm.slackware.com
Slackware ARM / AArch64 — Official Port
Slackware ARM provides an official first-party installer specifically tailored for the Raspberry Pi - so it's super simple! Just follow the installation guide. ... Slackware AArch64 Installer Updates: SD Card Decoupling, Generic U-Boot Support & 4K Display Improvements
🌐
LinuxVox
linuxvox.com › blog › linux-aarch64
A Comprehensive Guide to Linux on AArch64 Architecture — linuxvox.com
Replace /dev/sdX with the actual device name of your SD card. 3. Insert the SD card into the Raspberry Pi 4 and power it on. Follow the on-screen instructions to complete the installation process.
🌐
Arm Developer
developer.arm.com › downloads › - › gnu-a
Downloads | GNU-A Downloads – Arm Developer
Download the toolchain manifest file from the GNU Arm toolchain page on developer.arm.com, for example: gcc-arm-aarch64-none-elf-abe-manifest.txt. ... The built toolchain will be installed and available for use in the builds/destdir/x86_64-unknown-linux-gnu/bin/ directory.
🌐
Arch Linux ARM
archlinuxarm.org › packages › aarch64 › archinstall
archinstall (aarch64) | Packages | Arch Linux ARM
Copyright ©2009-2026 Arch Linux ARM The registered trademark Linux® is used pursuant to a sublicense from LMI, the exclusive licensee of Linus Torvalds, owner of the mark on a world-wide basis. The Arch Linux™ name and logo are used under permission of the Arch Linux Project Lead
🌐
Debian
wiki.debian.org › Arm64Qemu
Arm64Qemu - Debian Wiki
# retrieve the latest netinst ARCH=arm64 URL="https://cdimage.debian.org/debian-cd/current/$ARCH/iso-cd" ISO=$(wget --no-verbose --no-cache -O- $URL/SHA512SUMS | awk '/debian-[0-9.]*-'$ARCH'-netinst.iso$/ {print $2}') wget --no-verbose $URL/$ISO # detect path for vm disks DIR=$(virsh --quiet pool-dumpxml --pool default --xpath '//path/text()') # Start the installation virt-install -v --name bookworm-$ARCH --ram 4096 \ --disk path=$DIR/bookworm-aarch64.img,cache=none,size=10 --nographics \ --osinfo debiantrixie --import --arch aarch64 --vcpus 4 --cdrom $ISO
🌐
Arch Linux
archlinux.org › packages › extra › x86_64 › aarch64-linux-gnu-gcc
Arch Linux - aarch64-linux-gnu-gcc 16.1.0-1 (x86_64)
aarch64-linux-gnu-binutils · aarch64-linux-gnu-glibc · libisl · libmpc · zlib · zstd · gmp (make) mpfr (make) aarch64-linux-gnu-glibc · rust-aarch64-gnu · rust-aarch64-musl · rustup (optional) edk2 (make) efifs (make) lib32-rust-libs (make) musl (make) rust (make) View the file list for aarch64-linux-gnu-gcc ·
🌐
PINE64
pine64.org › documentation › Quartz64 › Software › Installing_Arch_Linux_ARM
Installing Arch Linux ARM — Quartz64
September 3, 2025 - # mount /dev/sdX5 /mnt/alarm-root # mkdir /mnt/alarm-root/boot # mount /dev/sdX4 /mnt/alarm-root/boot # bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/alarm-root