I'm not sure how exactly the packages relate, but I needed to install the gcc package to resolve some sort of load error. Given that gcc didn't produce any results, I ran a quick

Copy$ conda search gcc

Which yielded, among other things, gcc_linux-64. After

Copy$ conda install gcc_linux-64

My issue went away, despite the fact that which gcc still pointed to the system install 🤷‍♂️

Answer from dsfbmmg on Stack Overflow
🌐
Anaconda.org
anaconda.org › conda-forge › gcc
gcc - conda-forge | Anaconda.org
conda-forge/gcc · Community · GNU C native compiler (symlinks) Copied fromcf-post-staging / gcc · Overview · Files 797 · Labels 5 · Badges · Versions · 15.2.0 · To install this package, run one of the following: $conda install conda-forge::gcc · Monthly · Downloads Updates ·
🌐
conda-forge
conda-forge.org › blog › 2025 › 11 › 21 › gcc-macos
gcc, g++ builds on macos | conda-forge | community-driven packaging for conda
November 21, 2025 - Today, we announce the availability of gcc, g++ compilers on macos. You can install them using:
🌐
Prefix.dev
prefix.dev › channels › conda-forge › packages › gcc
gcc - conda-forge
pixi add gcc · conda install -c https://prefix.dev/conda-forge gcc · gcc package does not contain a description · Loading chart data... 15.2.0 · BSD-3-Clause · linux-64 · linux-aarch64 · linux-ppc64le · osx-64 · osx-arm64 · win-64 ...
🌐
Anaconda.org
anaconda.org › conda-forge › libgcc › files
libgcc - conda-forge | Anaconda.org
Install libgcc with Anaconda.org. The GCC low-level runtime library
🌐
Conda
docs.conda.io › projects › conda-build › en › stable › resources › compiler-tools.html
Anaconda compiler tools — conda-build 0.0.0.dev0+placeholder documentation
This is done by changing the link_libgcc: section inside GCC specs file, and this change is done so that LD_LIBRARY_PATH isn't required for basic libraries. conda-build knows how to make this automatically relocatable, so that this RPATH will be changed to point to the environment where the package is being installed (at installation time, by conda).
Top answer
1 of 5
20

I'm still on Ubuntu 22.04 LTS but needed g++14. The sudo apt-get gcc-14 did not work for me, as it installed clang++14 for some reason (perhaps a misconfiguration on my part). What did work for me was following the instructions I found at https://www.dedicatedcore.com/blog/install-gcc-compiler-ubuntu/

The steps I took:

sudo apt install build-essential
sudo apt install libmpfr-dev libgmp3-dev libmpc-dev -y
wget https://ftp.gnu.org/gnu/gcc/gcc-14.1.0/gcc-14.1.0.tar.gz
tar -xf gcc-14.1.0.tar.gz
cd gcc-14.1.0
./configure -v --build=$(uname -m)-linux-gnu --host=$(uname -m)-linux-gnu --target=$(uname -m)-linux-gnu --prefix=/usr/local/gcc-14.1.0 --enable-checking=release --enable-languages=c,c++ --disable-multilib --program-suffix=-14.1.0
make
sudo make install

And if you would like to make it the default:

sudo update-alternatives --install /usr/bin/g++ g++ /usr/local/gcc-14.1.0/bin/g++-14.1.0 14
sudo update-alternatives --install /usr/bin/gcc gcc /usr/local/gcc-14.1.0/bin/gcc-14.1.0 14

After that, g++ showed I was running version 14.1.0. I was then able to compile my project that included some c++20/23 features that were not in the previous versions of g++ (chrono/format).

2 of 5
16

GCC-14 (and G++-14) is available in the Universe repository for Ubuntu 24.04, as evident in the Ubuntu Package archive.

It is equally evident that this package is not available for Ubuntu 22.04, so installing this on 22.04 will require some third-party interference, or you have to compile it yourself.

See here on how to enable the Universe repositories.

🌐
conda-forge
conda-forge.org › user documentation › faq
FAQ | conda-forge | community-driven packaging for conda
We do this because it makes it possible to then install them anywhere like any other conda package. As a result, the builtin search path for the compilers only contains the sysroot they were built with. The compiler binary names are also ‘prefixed' with more complete information about the architecture and ABI they target. So, instead of gcc, the actual binary will be named something like x86_64-conda-linux-gnu-cc.
Find elsewhere
🌐
Anaconda.org
anaconda.org › conda-forge › gcc › files
gcc - conda-forge
Install gcc with Anaconda.org. GNU C native compiler (symlinks)
🌐
NVIDIA
docs.nvidia.com › cuda › cuda-installation-guide-linux
CUDA Installation Guide for Linux — Installation Guide for Linux 13.3 documentation
May 21, 2026 - This guide covers four primary installation methods: package manager installation (recommended for most users, supporting RPM and DEB packages with native package management integration), runfile installation (distribution-independent standalone installer), Conda installation (for environment management), and pip wheels (Python-focused runtime installation).
🌐
Narkive
conda.continuum.narkive.com › QB7lx2xd › using-the-gcc-package
[conda] Using the gcc package
There seem to be two general approaches: (1) Patch the gcc source to avoid running the "fixincludes" step while gcc is building, OR (2) Let fixincludes.sh run, but then "undo" its effects by deleting the header files it produced. (See the appendix below for categorized links.) (If necessary, I suppose we could imagine a 3rd approach: Run the fixincludes step as a post-install step on the target system, i.e. AFTER running "conda install gcc".
🌐
H-chen
h-chen.com › minds › html › Conda.html
Conda
- conda install https://anaconda.org/brown-data-science/gcc/7.1.0/download/linux-64/gcc-7.1.0-0.tar.bz2
🌐
Anaconda.org
anaconda.org › conda-forge › gcc › files
13.2.0
GNU C native compiler (symlinks) copied from cf-post-staging / gcc · Conda · Files · Labels · Badges · No files were selected × · Filters · Type: All · All · conda · Version: 13.2.0 · All · 15.2.0 · 15.1.0 · 14.3.0 · 14.2.0 · 14.1.0 · 13.4.0 · 13.3.0 ·
🌐
GitHub
github.com › conda › conda-recipes › blob › master › cross-compilers › compilers_generic › install-gcc.sh
conda-recipes/cross-compilers/compilers_generic/install-gcc.sh at main · conda-archive/conda-recipes
make -C gcc prefix=${PREFIX} install-driver install-cpp install-gcc-ar install-headers install-plugin ... # for file in gnat1 brig1 cc1 cc1plus f951 go1 lto1 cc1obj cc1objplus; do if [ -f $file ] ; then rm -f /home/ray/mcf-x-cos6_6...
Author   conda-archive
Top answer
1 of 2
2

Just to share, not sure it will help you. However it shows that in standard conditions it is possible to use the conda gcc as described in the documentation instead of the system gcc.

# system gcc
which gcc && gcc --version
# /usr/bin/gcc
# gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

# creating a conda env with gcc
conda create -n gcc gcc
# activate the environment
conda activating gcc
which gcc && gcc --version
# /opt/conda/envs/gcc/bin/gcc
# gcc (GCC) 11.2.0

Here is the list of packages installed on a fresh environment created with only gcc.

# packages in environment at /opt/conda/envs/gcc:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
binutils_impl_linux-64    2.36.1               h193b22a_2    conda-forge
gcc                       11.2.0               h702ea55_2    conda-forge
gcc_impl_linux-64         11.2.0              h82a94d6_11    conda-forge
kernel-headers_linux-64   2.6.32              he073ed8_15    conda-forge
ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
libgcc-devel_linux-64     11.2.0              h0952999_11    conda-forge
libgcc-ng                 11.2.0              h1d223b6_11    conda-forge
libgomp                   11.2.0              h1d223b6_11    conda-forge
libsanitizer              11.2.0              he4da1e4_11    conda-forge
libstdcxx-ng              11.2.0              he4da1e4_11    conda-forge
sysroot_linux-64          2.12                he073ed8_15    conda-forge
2 of 2
0

In addition to the solution posted in this issue. I added symbolic-links that point to the conda installed gcc, which I was missing.

ln -s /home/envs/segmentation_base/bin/x86_64-conda_cos6-linux-gnu-cc gcc
ln -s /home/envs/segmentation_base/bin/x86_64-conda_cos6-linux-gnu-cpp g++