Even though it’s “just” a compiler, GCC is tied to a number of core packages, which means it’s difficult to upgrade to a newer version than the version around which a Debian release is based (in Debian 11, that’s GCC 10). Ultimately you risk breaking your setup.

You could manually build GCC 11 on your Debian 11 system, but in practice it should be much easier to run your builds in a Debian 12 container (which will have GCC 11).

Answer from Stephen Kitt on Stack Exchange
🌐
GNU
gcc.gnu.org › releases.html
GCC Releases - GNU Project
April 30, 2026 - GCC releases may be downloaded from our mirror sites.
🌐
SourceForge
sourceforge.net › home › open source software › software development › build tools › gcc-win64
Download gcc-11.4.0-no-debug.7z (gcc-win64)
GnuWin GnuWin provides Win32-versions of GNU tools, or tools with a similar open source licence. The ports are native ports, relying only on libraries provided with any modern 32-bits MS-Windows operating system, such as 2000 / XP / Vista / 7 · 78 Reviews Downloads: 36,988 This Week Last Update: 2015-05-20 ... Get notified by email when gcc-win64 releases a new version.
🌐
Ubuntu
packages.ubuntu.com › jammy › gcc-11
Ubuntu – Details of package gcc-11 in jammy
Download Source Package gcc-11: [gcc-11_11.4.0-1ubuntu1~22.04.3.dsc] [gcc-11_11.4.0.orig.tar.gz] [gcc-11_11.4.0-1ubuntu1~22.04.3.debian.tar.xz] Maintainer: 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
2

This is not recommended but you can install version 11.3 by downloading gcc-11 (version 11.3) from here. And downloading the dependencies gcc-11-base and libgcc-11-dev.

Then, run sudo apt install /path/to/file where /path/to/file is the path to the actual downloaded file. If it can't find the file, you may need to put it in double quotes like "/path/to/file".

You will need to install the gcc-11-base package first, then libgcc-11-dev and finally, gcc-11.

For example, if it's downloaded to your Downloads directory:

sudo apt install $HOME/Downloads/gcc-11-base_11.3.0-6ubuntu1_amd64.deb

and

sudo apt install $HOME/Downloads/libgcc-11-dev_11.3.0-6ubuntu1_amd64.deb

and

sudo apt install $HOME/Downloads/gcc-11_11.3.0-6ubuntu1_amd64.deb

I'm pretty sure gcc only requires gcc-11 >11.2 so this should downgrade your version of gcc and when you're done compiling or whatever you need it for, simply run:

sudo apt update
sudo apt install --reinstall gcc-11 gcc-11-base libgcc-11-dev

to upgrade back to the current version of gcc-11 (11.4).

Granted, the installation isn't guaranteed to work, could be insecure or lacking security updates. Also, you may run into dependency issues. If that's the case, you'd have to tread carefully or install each dependency one by one but always pay attention to what, if any, packages would need to uninstall when installing weird versions because you don't want to inadvertently uninstall a bunch of stuff you want or need.


EDIT: you will need to install dependencies (included above) but you can run the following commands to do it more quickly.

Run the following commands to create a working directory and download the packages:

cd
mkdir GCC11.3
cd GCC11.3
wget 'http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-11/gcc-11-base_11.3.0-6ubuntu1_amd64.deb'
wget 'http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-11/libgcc-11-dev_11.3.0-6ubuntu1_amd64.deb'
wget 'http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-11/gcc-11_11.3.0-6ubuntu1_amd64.deb'

Now, install the packages. Again, however, remember to pay attention to what, if any packages will be uninstalled when you install these weird versions. Review the list before you select Y to accept the changes!:

sudo apt install ./gcc*.deb

And again, when you're done compiling or whatever you need gcc 11.3 for, simply run:

sudo apt install --reinstall gcc-11 gcc-11-base libgcc-dev

to upgrade back to gcc 11.4.

🌐
Pkgs.org
pkgs.org › download › gcc
Gcc Download (APK, DEB, EOPKG, IPK, PKG, RPM, TXZ, XBPS, XZ, ZST)
Download gcc packages for Adélie, AlmaLinux, Alpine, ALT Linux, Amazon Linux, Arch Linux, CentOS, Debian, Fedora, FreeBSD, KaOS, Mageia, OpenMandriva, openSUSE, OpenWrt, PCLinuxOS, Rocky Linux, Slackware, Solus, Ubuntu, Void Linux
🌐
GNU
gcc.gnu.org
GCC, the GNU Compiler Collection - GNU Project
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Objective-C++, Fortran, Ada, Go, D, Modula-2, COBOL, Rust, and Algol 68 as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the GNU operating system.
Find elsewhere
🌐
GNU
gcc.gnu.org › gcc-11
GCC 11 Release Series - GNU Project
To obtain GCC please use our mirror sites or our version control system.
🌐
Wikidata
wikidata.org › wiki › Q178940
GNU Compiler Collection - Wikidata
legacy version · bug-fix release · download URL · https://ftpmirror.gnu.org/gcc/gcc-11.4.0/ 1 reference · reference URL · https://lists.gnu.org/archive/html/info-gnu/2023-05/msg00013.html · title · GCC 11.4 Released (English) author · ...
🌐
Pkgs.org
pkgs.org › download › gcc-11
Gcc-11 Download for Linux (apk deb)
Search and download Linux packages for Adélie, AlmaLinux, Alpine, ALT Linux, Arch Linux, CentOS, Debian, Fedora, KaOS, Mageia, Mint, OpenMandriva, openSUSE, OpenWrt, RHEL, Rocky Linux, Slackware, Solus, Ubuntu and Void Linux distributions
🌐
DedicatedCore
dedicatedcore.com › home › how to install gcc compiler on ubuntu 22.04
How to Install GCC Compiler on Ubuntu 22.04 - DedicatedCore Blog
January 24, 2025 - Installing the GCC compiler and obtaining the GCC source code from authorized repositories: Run the Command below to Install the required Dependencies: ... Download the GCC source code from the GCC website using the wget command.
🌐
Lbl
scienceit-docs.lbl.gov › hpc › software › compilers › gcc
GCC - Science IT Technical Documentation
August 13, 2024 - Several gcc compiler versions are available on Lawrencium. The default gcc compiler is gcc/11.4.0 available through module load gcc. Two other gcc versions are available: gcc/10.5.0 and gcc/13.2.0.
🌐
Linux From Scratch
linuxfromscratch.org › blfs › view › 11.0 › general › gcc.html
GCC-11.2.0
In case that happens, the “fixed” headers must be updated by running (as root): /usr/libexec/gcc/x86_64-pc-linux-gnu/11.2.0/install-tools/mkheaders . The machine triplet may be different on a 32bit system. Download (HTTP): https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz
🌐
Ubuntu
launchpad.net › ubuntu › noble › +source › gcc-11
Noble (24.04) : gcc-11 package : Ubuntu
Current version: 11.5.0-1ubuntu1~24.04.1 · Uploaded: 2026-01-16 · Urgency: Medium Urgency · gcc ⇒ head · The GNU Compiler Collection contains frontends for C, C++, Objective-C, Fortran, Java, and Ada as well as libraries for these languages. Bug supervisor: no · Bug tracker: yes · Branch: yes · Translations: no · There are no registered releases for the gcc ⇒ head. Show upstream links · 11.4.0-4ubuntu1 ·
🌐
Ubuntu
launchpad.net › ubuntu › +source › gcc-11
gcc-11 package in Ubuntu
+-11-dev: GNU Standard C++ Library v3 (development files) libx32stdc+ ... This package has 9 new bugs and 0 open questions. ... The GNU Compiler Collection contains frontends for C, C++, Objective-C, Fortran, Java, and Ada as well as libraries for these languages. ... There are no registered releases for the gcc ⇒ head. ... Other versions of 'gcc-11' in untrusted archives.
🌐
GNU
gcc.gnu.org › install
Installing GCC - GNU Project
The latest version of this document is always available at https://gcc.gnu.org/install/. It refers to the current development sources, instructions for specific released versions are included with the sources · This document describes the generic installation procedure for GCC as well as detailing ...
🌐
DevDocs
devdocs.io › gcc~11
DevDocs — GCC 11 documentation
GCC 11.4.0 API documentation with instant search, offline support, keyboard shortcuts, mobile version, and more.