Red Hat Enterprise Linux, being an "enterprise" operating system, is designed to be stable and similar for a long time. That means you do not get the "latest and greatest" by default, but a known-good implementation that remains the default on that particular RHEL version for the long term. Generally you only get substantial software upgrades by upgrading RHEL. Unfortunately, there is no RHEL 8 yet.

devtoolset allows you to switch to newer, out-of-band versions of development software like GCC, in a way that doesn't "contaminate" the whole OS installation. I used it, with great success, to get GCC 4.8 (and its C++11 support) on CentOS 6, where the official GCC is 4.4.

devtoolset-8 has GCC 8.2.1.

Or you could choose to use a distribution more suited for home users, such as Fedora.

Or you could download the GCC source and build it yourself (but ew!).

Answer from Lightness Races in Orbit on Stack Overflow
🌐
Red Hat
access.redhat.com › solutions › 19458
What GCC versions are available in Red Hat Enterprise Linux? - Red Hat Customer Portal
What GCC versions are available in Red Hat Enterprise Linux? What C and C++ compiler comes with RHEL, GCC Toolset, Developer Toolset? Are the GCC Toolset and Developer Toolset available for my RHEL version?
🌐
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 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 ...
Discussions

Why RHEL 8 is shipping with Linux Kernel 4.18 and GCC 8.2?

Generally speaking with any Red Hat releases software, you can’t look only at upstream version number comparisons, but instead also need to look at the errata to see what has been patched. RH will keep versions steady for a long period of time, but will “back-port” bugs. This means if something relevant was fixed in the latest kernel, and it doesn’t break functionality in GCC 8.2, then RH has the ability to port the fix back to the RHEL 8 kernel version.

GCC is of particular note because RH made the realization years ago that although keeping GCC constant helps with enterprise compatibility needed by their customers, developers hate missing out on newer features. This is why RH offers the Software Collections channel, so that the latest dev tools can be pulled down and used.

More on reddit.com
🌐 r/redhat
19
6
June 13, 2019
rhel - How to install gcc 9.X on RHEL8? - Unix & Linux Stack Exchange
I see from the documentation here ... 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 have both and gcc is still at 8.X. If I go through dnf with dnf search gcc | grep 9 there are a great deal of references to gcc v9, but no way to actually install it. There is something called gcc-toolset-9, but after checking it out, it is unrelated to the core gcc version... More on unix.stackexchange.com
🌐 unix.stackexchange.com
May 7, 2020
yum - How to install newer GCC version in RHEL 8 - Unix & Linux Stack Exchange
The Linux machine I am using uses Red Hat Enterprise Linux (RHEL) version 8.10. It currently has GCC version 8.5.0 which supports up to C++14. However, I need to use C++17. How do I install a newer More on unix.stackexchange.com
🌐 unix.stackexchange.com
3 days ago
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
Top answer
1 of 2
8

Red Hat Enterprise Linux, being an "enterprise" operating system, is designed to be stable and similar for a long time. That means you do not get the "latest and greatest" by default, but a known-good implementation that remains the default on that particular RHEL version for the long term. Generally you only get substantial software upgrades by upgrading RHEL. Unfortunately, there is no RHEL 8 yet.

devtoolset allows you to switch to newer, out-of-band versions of development software like GCC, in a way that doesn't "contaminate" the whole OS installation. I used it, with great success, to get GCC 4.8 (and its C++11 support) on CentOS 6, where the official GCC is 4.4.

devtoolset-8 has GCC 8.2.1.

Or you could choose to use a distribution more suited for home users, such as Fedora.

Or you could download the GCC source and build it yourself (but ew!).

2 of 2
4

One can surely build the gcc on CentOS oneself(though ew!).

Generally follow the below steps:

sudo yum -y update
sudo yum -y install bzip2 wget gcc gcc-c++ gmp-devel mpfr-devel libmpc-devel make
gcc --version
wget http://mirrors-usa.go-parts.com/gcc/releases/gcc-8.2.0/gcc-8.2.0.tar.gz
tar zxf gcc-8.2.0.tar.gz
mkdir gcc-8.2.0-build
cd gcc-8.2.0-build
../gcc-8.2.0/configure --enable-languages=c,c++ --disable-multilib
make -j 2
sudo make install
gcc --version

At this point, many can not see 8.2, i.e.

gcc version 4.8.5 (GCC)

Just overwrite the old gcc with which just built, i.e.

# which gcc
/usr/local/bin/gcc
# cp gcc/xgcc /usr/local/bin/gcc
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/aarch64-unknown-linux-gnu/7.2.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: ../gcc-7.2.0/configure --enable-languages=c,c++ --disable-multilib
Thread model: posix
gcc version 7.2.0 (GCC)

In order to avoid library error, one may need update libstdc as well,

cp ./aarch64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6 /usr/local/lib64/libstdc++.so.6
cp ./stage1-aarch64-unknown-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6 /usr/lib64/libstdc++.so.6

One may also update libc.so as well, i.e. 2.18

curl -O http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz
tar zxf glibc-2.18.tar.gz
cd glibc-2.18/
mkdir build
cd build/
../configure --prefix=/usr
make -j2
make install
ln -sf /usr/glibc-2.18/glibc-2.18.so /lib64/libc.so.6

Finally, type /lib64/libc.so.6 to confirm

Mostly, ln would fail, since old relations, and LD is suggested, i.e.

LD_LIBRARY_PATH=/usr/glibc-2.18/lib
export LD_LIBRARY_PATH
🌐
Reddit
reddit.com › r › redhat › comments › bzr75w › why_rhel_8_is_shipping_with_linux_kernel_418_and
r/redhat - Why RHEL 8 is shipping with Linux Kernel 4.18 and GCC 8.2?
June 13, 2019 -

First, sorry if my question sounds more like a complaint from some very uneducated random user. I'm really not an expert indeed, but I'm aware that version 4.18 of the Linux kernel ceased to be supported upstream for very long now. Also GCC 8.3 came out much longer before RHEL 8 was released. Since I've always been told that systems like RHEL are mainly focused on servers, data centers and mission critical tasks in general.. what is the rationale behind the choice of which version to include? Isn't GCC 8.2 much "buggier" than 8.3? Shouldn't it be wiser for such a system to ship with less buggy software in the first place? Thanks for your patience and time.

🌐
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 10. Binaries, shared libraries and objects built using this standard can be freely mixed ...
🌐
Tenable
tenable.com › plugins › nessus › 216158
RHEL 8 : gcc-toolset-14-gcc (RHSA-2025:1338)<!-- --> | Tenable®
February 12, 2025 - Update the RHEL gcc-toolset-14-gcc package based on the guidance in RHSA-2025:1338. https://access.redhat.com/security/updates/classification/#moderate · https://bugzilla.redhat.com/show_bug.cgi?id=1850004 ... Supported Sensors: Frictionless Assessment AWS, Frictionless Assessment Azure, ...
Find elsewhere
🌐
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.
🌐
SciVision
scivision.dev › install-modern-compilers-redhat
Use modern compilers in RHEL | Scientific Computing
July 2, 2023 - GCC Toolset enables modern compilers and libraries in RHEL.
🌐
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 - Learn to install the GCC compiler on RHEL 8/CentOS 8 and compile a C program. Step-by-step guidance for developers.
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_enterprise_linux › 8 › html › considerations_in_adopting_rhel_8 › compilers-and-development-tools_considerations-in-adopting-rhel-8
Chapter 17. Compilers and development tools | Considerations in adopting RHEL 8 | Red Hat Enterprise Linux | 8 | Red Hat Documentation
The Application Binary Interface (ABI) of the std::string and std::list classes from the libstdc++ library changed between RHEL 7 (GCC 4.8) and RHEL 8 (GCC 8) to conform to the C++11 standard. The libstdc++ library supports both the old and new ABI, but some other C++ system libraries do not.
🌐
Tenable
tenable.com › plugins › nessus › 216109
RHEL 8 : gcc (RHSA-2025:1301)<!-- --> | Tenable®
February 11, 2025 - Tenable has extracted the preceding description block directly from the Red Hat Enterprise Linux security advisory. Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version number. Update the RHEL gcc package based on the guidance in RHSA-2025:1301.
🌐
Tenable
tenable.com › plugins › nessus › 155148
RHEL 8 : gcc-toolset-10-gcc (RHSA-2021:4585)<!-- --> | Tenable®
November 10, 2021 - Tenable has extracted the preceding description block directly from the Red Hat Enterprise Linux security advisory. Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version number. Update the RHEL gcc-toolset-10-gcc package based ...