I'd recommend using yum localinstall rather than using the rpm command directly; that way you'll have the gcc package in your yum database so that it can keep track of updates. The command would just be:

yum localinstall /mnt/cdrom/CentOS/gcc-(whatever).rpm
Answer from gareth_bowles on serverfault.com
🌐
LinuxQuestions.org
linuxquestions.org › questions › linux-newbie-8 › installing-gcc-rpm-on-red-hat-780713
Installing gcc rpm on Red Hat
I'm using Red Hat. I don't know how to tell which version, but here's this: Code: -bash-3.2 uname -a Linux lunchhub.com 2.6.9-023stab048.6-enterprise
🌐
Linux Puzzles
marksallee.wordpress.com › 2016 › 05 › 03 › gcc-4-9-2-install-rpm-or-source
GCC 4.9.2: install via RPMs or from source | Linux Puzzles
May 18, 2021 - Install a newer version of gcc, the developers ask. Should be easy, right? Not as easy as you might have hoped. RHEL 6 and 7 include a package set of RPMs called devtoolset, which will help you install gcc-4.9.2 and its dependencies. Installing the RPMs: If you have the old (classic) RHN registration, then install…
🌐
Fifi
fifi.org › doc › HOWTO › en-html › RPM-for-Unix-HOWTO-7.html
RPM-for-Unix HOW-TO: Create gcc RPM Package
www.fifi.org Documentation Manpages GNU Info Debian document tree Whole document tree Trigance web page Public services User info Mailing lists Secure server Multilingual usage · The GNU gcc rpm is the most important rpm package which you should create after successfully creating rpm of RPM ...
🌐
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 - To install all the packages belonging to a package group called “Development Tools” use the following command: # yum --setopt=group_package_types=mandatory,default,optional groupinstall "Development Tools" OR # yum --setopt=group_package_types=mandatory,default,optional group install "Development Tools" The yum has changed in Red Hat Enterprise Linux 7/CentOS 7. The package group “Development Tools”” has only the optional packages which by default doesn’t get installed. So we will need to pass the option --setopt=group_package_types=mandatory,default,optional to install the optional packages too. Type the following which command or type command/command command to see the gcc binary location.
🌐
GitHub
github.com › CJLove › gcc-rpm
GitHub - CJLove/gcc-rpm: Build script/packaging for alternative gcc rpms on Fedora · GitHub
This script will take a gcc source tarball (e.g. gcc-6.5.0.tar.gz), download associated dependencies, build gcc from source, and build an alt-gccX rpm for it. The rpm will install gcc into /opt/gccxyz.
Author   CJLove
Find elsewhere
🌐
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 - For instructions on how to enable the relevant RPMs and repositories. ... The Go compiler help command provides information on its usage. To show the help index: ... The scl list-collections will show the list of RHSCL packages that have been installed, whether they are enabled or not. ... In this article, we installed GCC development tools on RHEL 8 and created a simple cpp application that printed hello-world and executed by the GCC command line tool.
🌐
Hackaday
hackaday.io › page › 19822
Installing gcc for the 8088 on a RPM based Linux | Ken Yap | Hackaday.io
Cut to the chase, these are the ones that are needed: gcc-ia16-elf, binutils-ia16-elf, libi86-ia16-elf, and libnewlib-ia16-elf. ... Alien needs to be run as root or it will not be able to assign the correct ownership to the files in the resulting package. The -v shows progress messages, -k preserves the version number, and -r means the output should be a RPM package.
🌐
Red Hat
developers.redhat.com › articles › 2023 › 11 › 10 › install-gcc-and-build-hello-world-application-rhel-9
Install GCC and build a Hello World application on RHEL 9 | Red Hat Developer
November 10, 2023 - For instructions on how to enable the relevant RPMs and repositories. ... The Go compiler help command provides information on its usage. To show the help index: ... The scl list-collections will show the list of RHSCL packages that have been installed, whether they are enabled or not. ... As a result of this article, we installed the GCC development tools on RHEL 9 and created a simple cpp application that printed hello world and executed by the GCC command line tool.
🌐
iO Flood
ioflood.com › blog › install-gcc-command-linux
Installing and Using the GCC Command: Linux User Guide
January 2, 2024 - However, if it’s not, you can install it in Debian based distributions like Ubuntu, by running the command sudo apt-get install gcc. For RPM-based distributions like CentOS, you would run the command sudo yum install gcc.
🌐
Pkgs.org
pkgs.org › download › gcc-c++
Gcc-c++ Download for Linux (rpm)
Download gcc-c++ linux packages for AlmaLinux, ALT Linux, Amazon Linux, CentOS, Fedora, Mageia, OpenMandriva, openSUSE, PCLinuxOS, Rocky Linux
🌐
RPMfind
rpmfind.net › linux › rpm2html › search.php
RPM resource gcc
The GNU Compiler Collection (GCC) provides a standard conforming and highly portable ISO C and ISO C++ compiler.
🌐
Linuxize
linuxize.com › home › gcc › how to install gcc compiler on centos 7
How to Install GCC Compiler on CentOS 7 | Linuxize
October 31, 2019 - To add new repositories and install packages on your CentOS system, you must be logged in as root or user with sudo privileges . The default CentOS repositories contain a package group named Development Tools that contains the GCC compiler and a lot of libraries and other utilities required for compiling software.
🌐
Stack Exchange
unix.stackexchange.com › questions › 469462 › how-to-build-compiled-rpm-of-gcc-8-2
rpmbuild - how to build compiled rpm of gcc 8.2 - Unix & Linux Stack Exchange
I use this process to build gcc, and I want the packaged rpm to do exactly like this, precompiled. ./configure --with-system-zlib --disable-multilib --enable-languages=c,c++ --prefix=/opt/gcc-8.2.0 make -j 12 make install
🌐
Bobsteagall
bobsteagall.com › 2017 › 12 › 30 › gcc-builder
Building GCC on Linux – The State Machine
December 30, 2017 - The resulting RPM will be created in the ./packages subdirectory. On my CentOS-7 VM, the RPM file name is kewb-gcc720-0.el7.x86_64.rpm. You can install it using rpm or yum on the command line.
🌐
Experts Exchange
experts-exchange.com › questions › 29178462 › install-the-gcc-c-4-8-5-39-el7-x86-64-rpm-to-my-test-Centos-linux-box-make-it-to-emergency-mode-can't-start-GUI-anymore.html
Solved: install the gcc-c++4.8.5-39.el7.x86_64.rpm to my test Centos linux box make it to emergency mode, can't start GUI anymore. | Experts Exchange
April 11, 2020 - in emergency mode I can't run this: cat /var/log/yum.log | grep gcc it said ... so you likely have a mess now which can never be fixed. most likely! and what i did is install that rpm from CentOS application store ! amazing ! I don't like that CentoS linux thing, I downlaod all .rpm from repo of centos and all working fine except this!
🌐
Rpm-packaging-guide
rpm-packaging-guide.github.io
RPM Packaging Guide
$ dnf install gcc rpm-build rpm-devel rpmlint make python bash coreutils diffutils patch rpmdevtools
🌐
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 - Optional: Install the Clang static analysis tools scan-build and clang-tidy. Under your normal user ID, run scl enable to add devtoolset-8 and llvm-toolset-6.0 to your path(s). Optional: Permanently enable GCC 8 and Clang 6 by adding scl_source to your .bashrc. $ su - # subscription-manager repos --enable rhel-7-server-optional-rpms \ --enable rhel-server-rhscl-7-rpms \ --enable rhel-7-server-devtools-rpms # yum install devtoolset-8 llvm-toolset-6.0 # yum install llvm-toolset-6.0-clang-analyzer llvm-toolset-6.0-clang-tools-extra # optional # exit $ scl enable devtoolset-8 llvm-toolset-6.0 bash