I feel foolish because I figured it out right after posting, but I figured I'd share because it isn't intuitive and hopefully this will save someone some time.

The package you want to install is not gcc. You want to install gcc-toolset-9. You will notice after installation that you will still get 8.x if you do a gcc --version. gcc-toolset-9 installs to /opt. The idea is to give you a separate development environment. See this documentation. After installation you can run the updated gcc with /opt/rh/gcc-toolset-9/<username>/bin/gcc.

As @Stephen Kitt pointed out, you can actually get a shell with the updated toolset by running scl enable gcc-toolset-9 bash. Running this command will open a new bash session with the environment variables appropriately updated.

You can also run gcc v.9 directly with scl enable gcc-toolset-9 gcc <your_gcc_args>. See this documentation for details.

Answer from Grant Curell on Stack Exchange
🌐
OneUptime
oneuptime.com › home › blog › how to install gcc and development tools on rhel
How to Install GCC and Development Tools on RHEL
March 4, 2026 - # Install the complete development toolchain sudo dnf group install -y "Development Tools" # This installs: # - gcc (C compiler) # - gcc-c++ (C++ compiler) # - make (build automation) # - automake, autoconf (build system generators) # - libtool ...
Discussions

linux - how to install gcc 4.9.2 on RHEL 7.4 - Stack Overflow
I am trying to install gcc and g++ 4.9.2 on Linux. I'm pretty new with Linux and i saw some guides of how to install, but each time I encountered with another problem. I don't have any gcc right no... More on stackoverflow.com
🌐 stackoverflow.com
Will there be backward compatible compilers in RHEL 9
I could be wrong but off the top of my head I don't remember Red Hat shipping older compilers than the host's native version before. Then again you can always opens support request and see what the team says! A possible solution to your problem would be to continue building on RHEL 8 (using gcc-toolset as needed) and then verify runtime compatibility on RHEL 9. Containers can be used to do so if the host is RHEL 9. More on reddit.com
🌐 r/redhat
12
11
February 5, 2022
When will Gcc 14 be available via gcc-toolset?
gcc-toolset 13 is currently in RHEL9.4, I wouldn't expect 14 to be in 8.10, and as a result, likely not going to land in RHEL8 now that it's transitioning to Maintenance Phase. It could land in RHEL9 later as part of an application stream. More on reddit.com
🌐 r/redhat
8
4
May 16, 2024
c++ - How to install gcc/g++ 9 on CentOS 8 docker (centos:latest) - Stack Overflow
In order to use the C++17 include I need gcc-9 package in my centos docker. By default centos:latest (aka 8) will install gcc 8.3.1 from the regular distro repo. Is there any P... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Red Hat
access.redhat.com › documentation › en-us › red_hat_developer_toolset › 9 › html › user_guide › chap-gcc
Chapter 2. GNU Compiler Collection (GCC) | User Guide | Red Hat Developer Toolset | 9 | Red Hat Documentation
March 28, 2022 - In Red Hat Developer Toolset, the GNU C++ compiler is provided by the devtoolset-9-gcc-c++ package and is automatically installed with the devtoolset-9-toolchain package as described in Section 1.5, “Installing Red Hat Developer Toolset”.
🌐
LinuxQuestions.org
linuxquestions.org › questions › linux-newbie-8 › how-do-i-install-gcc-on-red-hat-9-a-156499
How do i install gcc on red hat 9
What dir do I put the tar.gz file in i downloaded it to home but do all programs get installed from /usr/local/src or something like that. I made sure
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_enterprise_linux › 9 › html › developing_c_and_cpp_applications_in_rhel_9 › assembly_additional-toolsets-for-development-rhel-9_developing-applications
Chapter 4. Additional toolsets for development | Developing C and C++ applications in RHEL 9 | Red Hat Enterprise Linux | 9 | Red Hat Documentation
... To access and run the GCC Toolset container image, use a standard container engine like Podman. Authenticate with the registry, pull the image, and launch a container to access an isolated, pre-configured toolchain for development. ... Podman is installed.
Top answer
1 of 4
22
yum install centos-release-scl-rh
yum install devtoolset-3-gcc devtoolset-3-gcc-c++
update-alternatives --install /usr/bin/gcc-4.9 gcc-4.9 /opt/rh/devtoolset-3/root/usr/bin/gcc 10
update-alternatives --install /usr/bin/g++-4.9 g++-4.9 /opt/rh/devtoolset-3/root/usr/bin/g++ 10
2 of 4
21

For installing the system compilers gcc, g++, the install command is # yum install gcc-c++ → Provides version 4.8.5 : /usr/bin/{ gcc, g++ }.

Other options: 1. gcc53-c++-5.3.0-1.el6.x86_64.rpm → https://drive.google.com/file/d/0B7S255p3kFXNRm9FVnZYUnhyZzg/view?usp=sharing&resourcekey=0-1N6zQa6Sbl_WycG1O9I7JA : Download and install : # cd Downloads/ && yum install ./gcc53-c++-5.3.0-1.el6.x86_64.rpm ..... Provides /usr/bin/{gcc53, g++53}.

  1. The devtoolset´s : https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/ → # yum-config-manager --enable rhel-server-rhscl-7-rpms

Install gcc, g++ version 4.9.2 : # yum install devtoolset-3-gcc-c++

Note : You can have as many gcc/g++ versions as you want, installed at the same time. ( The system compilers are a must.)


  1. gcc49-c++-4.9.3-1.el6.x86_64.rpm https://drive.google.com/file/d/1Pwq1ua80dGM72i7rpDNAIIdfcR1WK-hG/view?usp=sharing → Provides /usr/bin/{gcc49, g++49}.

  1. gcc63-c++-6.3.0-1.el7.x86_64.rpm https://drive.google.com/file/d/1t4WrgvpEP-6_NN3qMJhz9MS3CJhHrHKc/view?usp=sharing → Provides /usr/bin/{gcc63, g++63}.

  2. gcc45-c++-4.5.4-1.el7.x86_64.rpm https://drive.google.com/file/d/15aRg-BPhuyaEyZA9Jy-iAyC21_pwN7nD/view?usp=sharing → Provides /usr/bin/{gcc45, g++45, gfortran45}

  3. gcc42-c++-4.2.4-1.el6.x86_64.rpm https://drive.google.com/file/d/1eYWk6Nd63xeqqAUoJldNWRuwEGO6cAyv/view?usp=sharing → Provides /usr/bin/{gcc42, g++42}


  1. gcc73-c++-7.3.0-1.el7.x86_64.rpm https://drive.google.com/file/d/1PgwCP5tu8D0EJbJVTqJd7Vg8dJ4l4noi/view?usp=sharing → Provides /usr/bin/{gcc73, g++73}

  2. gcc48-c++-4.8.5-1.el6.x86_64.rpm https://drive.google.com/file/d/1w6fW6oSflDDYZt_cOpGj3QMEmzUC8Q9L/view?usp=sharing → Provides /usr/bin/{gcc48, g++48, gfortran48}

  3. gcc84-c++-8.4.0-1.el7.x86_64.rpm https://drive.google.com/file/d/1xgFtsiDi2uiB1B0AcOaSpxVizzET-pJf/view?usp=sharing → Provides /usr/bin/{gcc84, g++84, gfortran84}

Find elsewhere
🌐
Tutorial for Linux
tutorialforlinux.com › how to install gcc 15.2 from source on rhel 9 – step by step
How to Install GCC 15.2 from Source on RHEL 9 - Step by step • tutorialforlinux.com
October 27, 2025 - Install GCC 15 from source on RHEL 9 with step-by-step guide, covering dependencies, environment setup, and version switching.
🌐
Red Hat
developers.redhat.com › articles › 2025 › 04 › 16 › gcc-and-gcc-toolset-versions-rhel-explainer
GCC and gcc-toolset versions in RHEL: An explainer | Red Hat Developer
April 16, 2025 - For example, gcc-toolset-12 is available in RHEL 9, but its support ended in November 2024 (after two years) as part of the Application Streams life cycle. ... For long-term stability and support: Use the built-in system GCC (8.x in RHEL 8) if you need a compiler that's supported for the entire RHEL life cycle. For newer features: Use gcc-toolset if you need access to the latest GCC features, but be aware of the shorter 2-year support window. Note that you can install gcc and multiple versions of gcc-toolset (e.g., gcc-toolset-12 and gcc-toolset-14) concurrently on the same system, as they install to different paths.
🌐
TecMint
tecmint.com › home › open source › how to install gcc and development tools on rhel-based systems
How to Install GCC and Development Tools on RHEL Systems
August 13, 2024 - In this article, we will explain how to install GNU C and C++ compilers and their related development tools in RHEL-based distributions.
🌐
LinuxConfig
linuxconfig.org › home › how to install gcc the c compiler on rhel 8 / centos 8
How to install GCC the C compiler on RHEL 8 / CentOS 8
September 24, 2019 - The GCC compiler can be installed in RHEL 8 by simply using the dnf install command.
🌐
Red Hat
access.redhat.com › solutions › 19458
What GCC versions are available in Red Hat Enterprise Linux? - Red Hat Customer Portal
gcc · gdb · Category · Developer · Tags · c++ g++ rhel_3 · rhel_4 · rhel_5 · rhel_6 · This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers.
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_enterprise_linux › 9 › html-single › developing_c_and_cpp_applications_in_rhel_9 › index
Developing C and C++ applications in RHEL 9 | Red Hat Enterprise Linux | 9 | Red Hat Documentation
To develop C and C++ applications on Red Hat Enterprise Linux, you can use the development tools provided by Red Hat Enterprise Linux. This procedure describes how to install the standard development tools, including the GCC and LLVM toolchains.
🌐
ComputingForGeeks
computingforgeeks.com › home › install gcc and development tools on rhel 8 / centos 8
Install GCC and Development Tools on RHEL 8 / CentOS 8 [Guide]
August 17, 2023 - Step-by-step guide to gCC and Development Tools on RHEL 8 / CentOS 8. Includes commands, verification, and troubleshooting.