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
🌐
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.
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
Installing GCC5.2.0 in RHEL 8.8
One possible solution is to install these dependencies manually, using the source code from the GCC infrastructure.. You can follow the instructions in this Stack Overflow answer to configure and build each dependency with static libraries, and then use them to compile GCC 5.2.0. https://stackoverflow.com/questions/9450394/how-to-install-gcc-piece-by-piece-with-gmp-mpfr-mpc-elf-without-shared-libra Kerem Çeliker More on reddit.com
🌐 r/redhat
7
2
December 21, 2023
how to install gcc compiler on red hat linux without internet connection? - Stack Overflow
I want to install gcc compiler in the Redhat Linux VM where internet connection is not available. Using Scp software i'm downloading rpm files and moving to the VM. I would like to know what all are More on stackoverflow.com
🌐 stackoverflow.com
c - Installing gcc manually redhat - Stack Overflow
I am working on a system on which I am a non-root user. While trying to install gcc 5.1 in a custom directory as the present shared version of gcc isn't working for postgresql installation, I star... More on stackoverflow.com
🌐 stackoverflow.com
🌐
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
developers.redhat.com › blog › 2019 › 03 › 05 › yum-install-gcc-8-clang-6
How to install GCC 8 and Clang/LLVM 6 on Red Hat Enterprise Linux 7 | Red Hat Developer
November 1, 2023 - How to install the latest stable versions of GCC and Clang/LLVM on Red Hat Enterprise Linux. Also covers tips for working with software collections and permanently enabling GCC 8/Clang 6
🌐
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 just the C compiler sudo dnf install -y gcc # Install the C++ compiler sudo dnf install -y gcc-c++ # Install make separately sudo dnf install -y make # Verify the installations gcc --version g++ --version make --version · # Show the ...
🌐
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 - gcc --version gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10) Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ make --version GNU Make 4.2.1 Built for x86_64-redhat-linux-gnu Copyright (C) 1988-2016 Free Software Foundation, Inc.
🌐
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.
Find elsewhere
🌐
Red Hat
access.redhat.com › documentation › en-us › red_hat_enterprise_linux › 8 › html-single › developing_c_and_cpp_applications_in_rhel_8 › index
Developing C and C++ applications in RHEL 8 | Red Hat Enterprise Linux | 8 | Red Hat Documentation
May 17, 2023 - To develop C and C++ applications ... Linux. This procedure describes how to install the standard development tools, including the GCC and LLVM toolchains. ... The debug and source repositories must be enabled. ... Install the Development Tools package group including GNU Compiler Collection ...
🌐
Red Hat
developers.redhat.com › HW › gcc-RHEL-7
Hello World - installing GCC on RHEL 7 | Red Hat Developer
April 13, 2026 - If you are using a desktop edition of Red Hat Enterprise Linux, change -server- to -desktop- in the following commands: # subscription-manager repos --enable rhel-server-devtools-7-rpms # subscription-manager repos --enable rhel-7-server-optional-rpms · In this next step you will use a single command to download and install GCC 8.2, and other development tools that are part of Red Hat Developer Toolset.
🌐
Red Hat
docs.redhat.com › en › documentation › 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
Red Hat Developer Toolset is ... Hat Developer Toolset, the GNU C compiler is provided by the devtoolset-9-gcc package and is automatically installed with devtoolset-9-toolchain as described in Section 1.5, “Installing Red Hat Developer Toolset”....
🌐
Reddit
reddit.com › r/redhat › installing gcc5.2.0 in rhel 8.8
r/redhat on Reddit: Installing GCC5.2.0 in RHEL 8.8
December 21, 2023 -

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,

Top answer
1 of 1
2

yum manual:

deplist

Produces a list of all dependencies and what packages provide those dependencies for the given packages.

Try somenthing like:

$ yum deplist gcc

Output:

package: gcc.x86_64 4.8.5-4.el7
  dependency: /bin/sh
   provider: bash.x86_64 4.2.46-20.el7_2
  dependency: /sbin/install-info
   provider: info.x86_64 5.1-4.el7
  dependency: binutils >= 2.20.51.0.2-12
   provider: binutils.x86_64 2.23.52.0.1-55.el7
  dependency: cpp = 4.8.5-4.el7
   provider: cpp.x86_64 4.8.5-4.el7
  dependency: glibc-devel >= 2.2.90-12
   provider: glibc-devel.x86_64 2.17-106.el7_2.8
   provider: glibc-devel.i686 2.17-106.el7_2.8
  dependency: ld-linux-x86-64.so.2()(64bit)
   provider: glibc.x86_64 2.17-106.el7_2.8
  dependency: ld-linux-x86-64.so.2(GLIBC_2.3)(64bit)
   provider: glibc.x86_64 2.17-106.el7_2.8
  dependency: libc.so.6(GLIBC_2.14)(64bit)
   provider: glibc.x86_64 2.17-106.el7_2.8
  dependency: libdl.so.2()(64bit)
   provider: glibc.x86_64 2.17-106.el7_2.8
  dependency: libdl.so.2(GLIBC_2.2.5)(64bit)
   provider: glibc.x86_64 2.17-106.el7_2.8
  dependency: libgcc >= 4.8.5-4.el7
   provider: libgcc.x86_64 4.8.5-4.el7
   provider: libgcc.i686 4.8.5-4.el7
  dependency: libgcc_s.so.1()(64bit)
   provider: libgcc.x86_64 4.8.5-4.el7
  dependency: libgmp.so.10()(64bit)
   provider: gmp.x86_64 1:6.0.0-12.el7_1
  dependency: libgomp = 4.8.5-4.el7
   provider: libgomp.x86_64 4.8.5-4.el7
   provider: libgomp.i686 4.8.5-4.el7
  dependency: libgomp.so.1()(64bit)
   provider: libgomp.x86_64 4.8.5-4.el7
  dependency: libm.so.6()(64bit)
   provider: glibc.x86_64 2.17-106.el7_2.8
  dependency: libmpc.so.3()(64bit)
   provider: libmpc.x86_64 1.0.1-3.el7
  dependency: libmpfr.so.4()(64bit)
   provider: mpfr.x86_64 3.1.1-4.el7
  dependency: libz.so.1()(64bit)
   provider: zlib.x86_64 1.2.7-15.el7
  dependency: rtld(GNU_HASH)
   provider: glibc.x86_64 2.17-106.el7_2.8
   provider: glibc.i686 2.17-106.el7_2.8

Hope It Helps!

🌐
Red Hat
developers.redhat.com › blog › 2018 › 11 › 13 › gcc-8-2-ga-rhel
GCC 8.2 now GA for Red Hat Enterprise Linux | Red Hat Developer
March 24, 2023 - Like other tools, these are easily installable via yum, see How to install GCC 8 on Red Hat Enterprise Linux. Red Hat Developer Toolset and Red Hat Software Collections are included in the no-cost developer subscription for Red Hat Enterprise Linux. Twice a year, Red Hat distributes new versions of compiler toolsets, scripting languages, open source databases, and web tools providing application developers with access to the latest, stable versions.
🌐
nixCraft
cyberciti.biz › nixcraft › howto › centos › centos / rhel 7: install gcc (c and c++ compiler) and development tools
CentOS / RHEL 7: Install GCC (C and C++ Compiler) and Development Tools - nixCraft
April 5, 2024 - Explains how to install GNU C, C++ compiler and other development tools on a CentOS and RHEL (Red Hat Enterprise Linux) version 7.x server/workstation.
🌐
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
GCC Toolset and related toolsets provide newer compilers and debuggers for C, C++, and Fortran. Use these topics to install, use, and run container images for development. Red Hat Enterprise Linux 8 introduces the GCC Toolset, a compiler toolset that provides a variety of development and ...
🌐
Red Hat
developers.redhat.com › articles › build-your-first-app-native-gcc-rhel-6-or-7
Build your first app with native GCC on RHEL 6 or 7 | Red Hat Developer
January 2, 2024 - $ pass:[g++] -v gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ... Red Hat Developer Toolset provides the latest, stable, open source C and C++ compilers and complementary development tools including Eclipse. DTS enables developers to compile applications once and deploy across multiple versions of Red Hat Enterprise Linux. The Red Hat Developer Toolset uses Red Hat Software Collections to install a parallel set of packages in /opt/rh where they will not override the system packages that come with Red Hat Enterprise Linux.
🌐
Stack Overflow
stackoverflow.com › questions › 30806947 › installing-gcc-manually-redhat
c - Installing gcc manually redhat - Stack Overflow
You just run the script, which will download those prerequisites and unpack them so the are placed correctly in the GCC source tree. Then when you run the configure and build it will notice those directories and compile those extra libraries ...
🌐
LinuxQuestions.org
linuxquestions.org › questions › red-hat-31 › how-to-install-gcc-in-red-hat-enterprise-889304
how to install GCC in Red Hat Enterprise?
June 30, 2011 - Hi, does anyone know how to install the GCC compiler onto a Red Hat Enterprise system? Where to download it, and instructions to install it. Thank you.