🌐
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.
🌐
Red Hat
developers.redhat.com › articles › 2023 › 11 › 10 › install-gcc-and-build-hello-world-application-rhel-8
Install GCC and build a Hello World application on RHEL 8 | Red Hat Developer
November 10, 2023 - If you don’t have an active subscription, you can register and obtain the Red Hat Enterprise Linux Developer Suite (including the RHEL server). Managing software repositories in Red Hat Enterprise Linux 8 is essential for developers and system administrators. To find the necessary GCC-related repositories, you can use the following command.
Discussions

rhel - How to install gcc 9.X on RHEL8? - Unix & Linux Stack Exchange
I see from the documentation here that gcc has been updated on RHEL8, but what I haven't figured out is how to get it. The documentation indicates that there are now two streams, but I already hav... More on unix.stackexchange.com
🌐 unix.stackexchange.com
May 7, 2020
How to install gcc-toolset-11 on rocky 9.4?
I need to install it for autodesk maya2025 devkit, which requires RHEL or Rocky Linux 8.6 or higher, using DTS-11 with gcc 11.2.1 But not sure how to install it, dnf search only shows gcc-toolset 12 13 14 What is the easiest way to install other than build from source? More on forums.rockylinux.org
🌐 forums.rockylinux.org
1
0
October 1, 2024
yum - How to install a newer version of GCC in RHEL 8 - Unix & Linux Stack Exchange
Currently the best option is GCC toolset 15 which is supported until November 2029. On a system with access to RHEL repositories (online or through Satellite for example), install the toolset with ... (FYI OP) the scl is for Software Collections Library which also has newer non-Enterprise versions of things like python, etc. Aaron D. Marasco – Aaron D. Marasco · 2026-06-11 ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
1 week ago
linux - On el8/el9/newer, how do you get newer versions of software like python3, gcc, java, etc? - Stack Overflow
For example on el7: to develop an nvidia CUDA application you need a newer gcc than the default gcc version 4.8.x and to get the newer version you would use a software repo called "Software More on stackoverflow.com
🌐 stackoverflow.com
🌐
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.
🌐
Dotlinux
dotlinux.net › blog › how-to-install-gcc-the-c-compiler-on-rhel-8-centos-8
How to Install GCC (the C Compiler) on RHEL 8 / CentOS 8
sudo subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms · If you need a specific GCC version (e.g., GCC 11), use the module install command with the desired stream:
🌐
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 ...
🌐
SciVision
scivision.dev › install-modern-compilers-redhat
Use modern compilers in RHEL | Scientific Computing
July 2, 2023 - GCC Toolset enables modern compiler selection for RHEL users. G++ / Gfortran example: dnf install gcc-toolset-13-gcc-gfortran gcc-toolset-13-gcc-c++
🌐
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 - Package dependencies: gcc-toolset installs a full suite of dependent packages (e.g., gcc-toolset-9-*), while the built-in gcc does not force installation of these additional packages. 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.
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_enterprise_linux › 8 › html › developing_c_and_cpp_applications_in_rhel_8 › additional-toolsets-for-development_developing-applications
Chapter 4. Additional toolsets for development | Developing C and C++ applications in RHEL 8 | Red Hat Enterprise Linux | 8 | Red Hat Documentation
Using the C++11 language version is supported when all C++ objects compiled with the appropriate flag have been built using GCC version 5 or later. ... This language standard is available in the GCC Toolset 13. Binaries, shared libraries and objects built using this standard can be freely mixed regardless of being built with GCC from the GCC Toolset, Red Hat Developer Toolset, and RHEL 5, 6, 7 and 8.
Find elsewhere
🌐
OS Radar
osradar.com › home › linux › how to install gcc & development tools on centos 8 / rhel 8
How to Install GCC & Development Tools on Centos 8 / RHEL 8 - Linux Windows and android Tutorials
October 19, 2019 - In this tutorial you will cover to install GCC & Development tools on Centos / RHEL 8. RHEL 8 is advanced feature Operatig system for development....
🌐
Rocky Linux Forum
forums.rockylinux.org › rocky linux help & support
How to install gcc-toolset-11 on rocky 9.4? - Rocky Linux Help & Support - Rocky Linux Forum
October 1, 2024 - I need to install it for autodesk maya2025 devkit, which requires RHEL or Rocky Linux 8.6 or higher, using DTS-11 with gcc 11.2.1 But not sure how to install it, dnf search only shows gcc-toolset 12 13 14 What is the …
🌐
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.
🌐
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.
Top answer
1 of 1
1

in a nutshell, here are some examples for how to install and configure

  • for python3 to get python3.9: dnf install -y python39 && alternatives --set python3 $(command -v python3.9)
  • for gcc to get gcc-12: dnf install gcc-toolset-12 && source scl_source enable gcc-toolset-12
  • for java to get java-17: dnf install java-17 && bin_java_filename=$(rpm -qa|grep java-17|xargs rpm -ql|grep "bin\/java$"|head -1) && alternatives --set java ${bin_java_filename}
  • tested on rocky8, rocky9

which repo has the newer software versions?

  • the old method using "SCL" was deprecated
  • the new method is to use a repo called "appstream"
  • here is a post written by the distro maintainers explaining the change https://developers.redhat.com/blog/2018/11/15/rhel8-introducing-appstreams
  • the repo is enabled by default

how to: install newer software versions?

  • for python3: dnf install python39
  • for gcc: dnf install gcc-toolset-12

how to: change the system default?

  • for python3: alternatives --set python3 $(command -v python3.9)
  • for gcc:
    • edit your user .bashrc or .bash_profile or create a new file under /etc/profile.d/ with the following: source scl_source enable gcc-toolset-12
    • i thought scl_source would go away in el8, el9 but apparently not
    • for more info on scl_source go to this link https://unix.stackexchange.com/a/195219/5510 or Permanently enable RHEL scl

p.s. what is the difference between alternatives and update-alternatives?

  • the original tool is called update-alternatives and is from Debian linux distro
  • in EnterpriseLinux, Redhat rewrote the tool and called it alternatives and when you install alternatives the package also installs a symlink with name update-alternatives on your env var PATH to help you find the tool
  • the two are similar but not the same because their source code is different
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.

🌐
Linux Forum
forum.linuxconfig.org › linuxconfig.org articles
How to install GCC the C compiler on RHEL 8 - LinuxConfig.org - LinuxConfig.org Articles - Linux Forum
December 5, 2018 - The objective of this guide is to install GCC the C compiler on RHEL 8 and perform compilation of a basic C "Hello World" program. The GCC compiler can be installed in RHEL 8 by simply using the dnf install command. T…
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 11 › html › user_guide › chap-gcc
Chapter 2. GNU Compiler Collection (GCC) | User Guide | Red Hat Developer Toolset | 11 | Red Hat Documentation
In Red Hat Developer Toolset, the GNU C compiler is provided by the devtoolset-11-gcc package and is automatically installed with devtoolset-11-toolchain as described in Section 1.5, “Installing Red Hat Developer Toolset”.