🌐
Ubuntu
packages.ubuntu.com › focal › amd64 › libgcc-s1 › download
libgcc-s1_10.5.0-1ubuntu1~20.04_amd64.deb
two or more packages specified (libgcc-s1 focal) Content Copyright © 2025 Canonical Ltd.; See license terms. Ubuntu is a trademark of Canonical Ltd. Learn more about this site.
🌐
Ubuntu
packages.ubuntu.com › jammy › libgcc-11-dev
Ubuntu – Details of package libgcc-11-dev in jammy
Download Source Package gcc-11: [gcc-11_11.4.0-1ubuntu1~22.04.dsc] [gcc-11_11.4.0.orig.tar.gz] [gcc-11_11.4.0-1ubuntu1~22.04.debian.tar.xz] Maintainer: Ubuntu Core developers (Mail Archive) · Please consider filing a bug or asking a question via Launchpad before contacting the maintainer directly
🌐
Ubuntu
packages.ubuntu.com › focal-updates › libgcc-9-dev
Package: libgcc-9-dev (9.4.0-1ubuntu1~20.04.2)
two or more packages specified (libgcc-9-dev focal-updates) Content Copyright © 2026 Canonical Ltd.; See license terms. Ubuntu is a trademark of Canonical Ltd. Learn more about this site.
🌐
Ubuntu
packages.ubuntu.com › bionic › libgcc-7-dev
Ubuntu – Error
two or more packages specified (libgcc-7-dev bionic) Content Copyright © 2025 Canonical Ltd.; See license terms. Ubuntu is a trademark of Canonical Ltd. Learn more about this site.
🌐
Ubuntu
packages.ubuntu.com › focal › libgcc-s1
Details of package libgcc-s1 in focal
two or more packages specified (libgcc-s1 focal) Content Copyright © 2026 Canonical Ltd.; See license terms. Ubuntu is a trademark of Canonical Ltd. Learn more about this site.
🌐
Ubuntu
packages.ubuntu.com › jammy › libgcc-s1
Ubuntu – Details of package libgcc-s1 in jammy
» Ubuntu » Packages » jammy (22.04LTS) » libs » libgcc-s1 · [ jammy ] [ jammy-updates ] [ noble ] [ noble-updates ] [ plucky ] [ questing ] [ resolute ] [ Source: gcc-12 ] Bug Reports · Ubuntu Changelog · Copyright File · Download Source Package gcc-12: [gcc-12_12.3.0-1ubuntu1~22.04.2.dsc] [gcc-12_12.3.0.orig.tar.gz] [gcc-12_12.3.0-1ubuntu1~22.04.2.debian.tar.xz] Ubuntu Developers (Mail Archive) Please consider filing a bug or asking a question via Launchpad before contacting the maintainer directly.
Top answer
1 of 1
3

Disclaimer: I am fairly new to Ubuntu. I have a reasonable amount of experience with RHEL and SLES, and have had to learn Ubuntu LTS versions recently because of some ARM64 hardware that doesn't want to boot anything else.

Summary

Ubuntu releases do, indeed, often come with some components from a later GCC than the releases' default GCC. They apparently do this so that they can provide later compiler versions, if you want to use them.

  • The gcc-10-base package just provides documentation.
  • The libgcc-s1 package provides an important library, libgcc_s.so.1. That provides helper functions for code generated by the compiler: I know it as important for handling C++ exceptions being thrown through a C call stack.
  • Another important library is libstdc++.so.6. That provides C++ support functions.
  • Glibc (libc.so.6, libm.so.6 and other libraries) is also important, but is not tied to a GCC version.

All of these libraries have very strong compatibility rules. Essentially, a later version of the library will always be compatible with earlier versions, discounting some ancient versions from the early history of GCC and Linux.

It isn’t obvious at first why Ubuntu and Debian provide run-times that are later than the compiler, but it gets clearer when you look at the range of GCC versions available on recent Ubuntu LTS versions:

Distribution Released Debian GCC run-times Default GCC Additional GCCs
Ubuntu 16.04 Apr 2016 9.x 5.x 5.4 4.7, 4.8, 4.9
Ubuntu 18.04 Apr 2018 10.x 8.x 7.5 4.8, 5.5, 6.5. 8.4
Ubuntu 20.04 Apr 2020 11.x 9.x & 10.x 9.3 7.4, 8.4, 10.3
Ubuntu 22.04 Apr 2022 12.x 12.x 11.4 9.5, 10.5, 12.3

At that that point, it becomes reasonably obvious. Ubuntu 20.04 has the run-times for code compiled with GCC 9.x and 10.x (GCC 10.x doesn't demand any additional library functions that GCC 9.x didn't use). You can install any mixture of GCC 7.4, 8.4 and 10.3 as extra compilers, and they'll all work. The run-time libraries on Ubuntu 20.04 will support code compiled with any of those compilers.

Why not ship GCC 10.3 with Ubuntu 20.04? Run-time libraries are generally more stable than compilers. GCC 10 would have been first released (as 10.1) about the time that 20.04 was being put together. Building an LTS release with a brand-new compiler would be foolhardy; shipping new run-time libraries, after testing them with code built with GCC 9, is a lot safer and allows GCC 10 to be added when it has stabilised.

Canonical don't provide GCC 11 for 20.04 because it doesn't have the necessary run-times. For those, you need a later Ubuntu.

How to find all this stuff out

/usr/share/doc/gcc/README.Debian has some information.

dpkg-query --listfiles gcc-10-base shows us that gcc-10-base only provides documentation.

dpkg-query --listfiles libgcc-s1 shows us that libgcc-s1 provides /lib/x86_64-linux-gnu/libgcc_s.so.1, which is one of the basic run-time libraries for GCC.

The other basic run-time libraries for C/C++ are glibc, which is independent of GCC, and libstdc++. dpkg-query -list | grep libstdc shows us two packages:

ii libstdc++-9-dev:amd64 9.3.0-17ubuntu1~20.04 amd64 GNU Standard C++ Library v3 ...
ii libstdc++6:amd64 10.3.0-1ubuntu1~20.04 amd64 GNU Standard C++ Library v3

libstdc++6 is the GCC 10.3 version; the -dev package is the GCC 9.3 version.

dpkg-query --listfiles libstdc++-9-dev shows us that this package provides header files, archive libraries and documentation for developing in C++ with GCC 9.

dpkg-query --listfiles libstdc++6 shows us that this package provides documentation, some Python scripts and two really important files:

/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28

The .so.6 file is what programs are linked against. It is actually a softlink to the .so.6.028 file. That’s the name of the GCC 10 version of libstdc++, the GCC support library for C++. You can get the mapping between those names and GCC versions here. Scroll down, and you’ll find some tables.

GCC used for building Ubuntu

The easiest thing to check is glibc. Building this with a different compiler from the rest of the OS would be crazy, and you can find out what compiler was used to build it just by asking:

/usr/lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Ubuntu GLIBC 2.31-0ubuntu9.7) stable release version 2.31.
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 9.3.0.
libc ABIs: UNIQUE IFUNC ABSOLUTE
For bug reporting instructions, please see:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs.

Find elsewhere
🌐
Ubuntu
packages.ubuntu.com › search
Ubuntu – Package Contents Search Results -- libgcc_s.so.1
You have searched for files named libgcc_s.so.1 in suite trusty, all sections, and architecture(s) amd64.
🌐
Learn Ubuntu
learnubuntu.com › install-gcc
How to Install GCC on Ubuntu
December 5, 2022 - gcc is required for compiling C and C++ code on Ubuntu. You can install it directly or with other dev tools with the build-essential package.
🌐
Ubuntu
launchpad.net › ubuntu › noble › +package › libgcc-13-dev
libgcc-13-dev : Noble (24.04) : Ubuntu
This package contains the headers and static library files necessary for building C programs which use libgcc, libgomp, libquadmath, libssp or libitm. gcc-13 13.3.0-6ubuntu2~24.04.1 source package in Ubuntu
🌐
LinuxConfig
linuxconfig.org › home › how to install gcc the c compiler on ubuntu 22.04 lts jammy jellyfish linux
How to install GCC the C compiler on Ubuntu 22.04 LTS Jammy Jellyfish Linux
January 8, 2024 - Learn how to install GCC on Ubuntu 22.04. Follow our step-by-step guide to set up, verify, and compile C programs easily.
🌐
GitHub
gist.github.com › zchrissirhcz › ee13f604996bbbe312ba1d105954d2ed
Ubuntu Distro GCC GLIBC GLIBCXX C++-Standard versions · GitHub
Download ZIP · Ubuntu Distro GCC GLIBC GLIBCXX C++-Standard versions · Raw · versions.md · GLIBC versions: https://launchpad.net/ubuntu/+source/glibc https://code.launchpad.net/ubuntu/+source/glibc · cat /etc/os-releases · Pick one of ...
🌐
Ubuntu
launchpad.net › ubuntu › noble › +package › libgcc-s1
libgcc-s1 : Noble (24.04) : Ubuntu
libgcc-s1 · Shared version of the support library, a library of internal subroutines that GCC uses to overcome shortcomings of particular machines, or special needs for some languages. gcc-14 14.2.0-4ubuntu2~24.04.1 source package in Ubuntu ·
🌐
UbuntuUpdates
ubuntuupdates.org › package › core › focal › main › updates › libgcc-s1
UbuntuUpdates - Package "libgcc-s1" (focal 20.04)
gcc-10 (10.5.0-1ubuntu1~20.04) focal-proposed; urgency=medium · gcc-10 (10.3.0-1ubuntu1~20.04) focal-proposed; urgency=medium
🌐
Ubuntu
packages.ubuntu.com › trusty › amd64 › libgcc1 › download
Ubuntu – Package Download Selection -- libgcc1_4.9-20140406-0ubuntu1_amd64.deb
» Ubuntu » Packages » trusty » libgcc1 » amd64 » Download · If you are running Ubuntu, it is strongly suggested to use a package manager like aptitude or synaptic to download and install packages, instead of doing so manually via this website. You should be able to use any of the listed mirrors by adding a line to your /etc/apt/sources.list like this: deb http://cz.archive.ubuntu.com/ubuntu trusty main ·
🌐
Medium
medium.com › @xersendo › moving-to-c-26-how-to-build-and-set-up-gcc-15-1-on-ubuntu-f52cc9173fa0
Moving to C++26: How to Build and Set Up GCC 15.1 on Ubuntu
May 3, 2025 - Here we create a working directory (gcc-15) and clone the GCC source repo (https://gcc.gnu.org/git/gcc.git) into gcc-15-source, along with its necessary prerequisites (./contrib/download_prerequisites).
🌐
Ubuntu
documentation.ubuntu.com › ubuntu-for-developers › howto › gcc-setup
How to set up a development environment for GCC on Ubuntu - Ubuntu for Developers
2 weeks ago - This guide explains how to install GCC and related tooling on Ubuntu Desktop. The GNU Compiler Collection (GCC) is a set of compilers for programming languages, including C, C++, Assembly, and many...