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.
rhel - How to install gcc 9.X on RHEL8? - Unix & Linux Stack Exchange
Installing GCC5.2.0 in RHEL 8.8
how to install gcc compiler on red hat linux without internet connection? - Stack Overflow
c - Installing gcc manually redhat - Stack Overflow
Hi All,
I'm trying to install the GCC5.2.0 in RHEL 8.8 as it requires by the tool that I'm using. I'm installing it manually using its source code that I got from here:
Index of /gnu/gcc/gcc-5.2.0
These are the commands I'm using:
tar -xvf gcc-5.2.0.tar.gz
cd gcc-5.2.0
./contrib/download_prerequisites
./configure --enable-checking=release --enable-packages=c,c++ --disable-multilib
make -j 4
However, I'm getting an error under make -j 4:
I've already installed "Developer Tools" and "gcc-c++" which suggested online but i'm still getting the error.
Any idea how to fix this?
Regards,