You could possibly recompile gcc 4.8.5 with the following script. However there is a lot that can go wrong depending on the machine that you are compiling it since the compiler itself depends on a large set of utilities - called the toolchain and they are tightly coupled with the machine's own system libraries, in particular the C standard library.

Copysudo dpkg --add-architecture i386
sudo apt update
sudo apt upgrade
sudo apt-get install gcc-multilib libstdc++6:i386
wget https://ftp.gnu.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.bz2 --no-check-certificate
tar xf gcc-4.8.5.tar.bz2
cd gcc-4.8.5
./contrib/download_prerequisites
cd ..
sed -i -e 's/__attribute__/\/\/__attribute__/g' gcc-4.8.5/gcc/cp/cfns.h
sed -i 's/struct ucontext/ucontext_t/g' gcc-4.8.5/libgcc/config/i386/linux-unwind.h
mkdir xgcc-4.8.5
pushd xgcc-4.8.5
$PWD/../gcc-4.8.5/configure --enable-languages=c,c++ --prefix=/usr --enable-shared --enable-plugin --program-suffix=-4.8.5
make MAKEINFO="makeinfo --force" -j
sudo make install -j
Answer from Henrique Bucher on Stack Overflow
๐ŸŒ
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 - rpm -qa | grep -E -i "gcc" this return libgcc-8.3.1-4.5.el8.x86_6 ... yum -y install gcc-c++ yeah, working for me on other 2 x linux hosts which still fine after reboot then how to remove it using rpm on the failured nodes?
Discussions

Question regarding gcc-c++ package
Currently I'm getting a warning message in the prerequisite and it is expecting gcc-c++-4.8.2. Can i ignore and proceed further? ... PRVF-7532 : Package "gcc-c++" is missing on node "amandajay01" - Cause: A required package is either not installed or, if the package is a kernel module, is not ... More on community.oracle.com
๐ŸŒ community.oracle.com
October 6, 2020
Errors when compiling using custom GCC location
Hello, I have had the somewhat unfortunate experience of trying to install ROOT on an older Centos 6.4 system which does not have the appropriate GCC version(s) needed to compile the latest versions of ROOT (gcc versions in its yum repo stop at 4.4.7), so I had to grab GCC 4.8.2 and compile ... More on root-forum.cern.ch
๐ŸŒ root-forum.cern.ch
8
0
September 29, 2015
OraFAQ Forum: Linux ยป Missing Package: gcc-c++-3.4.6 (x86_64)
Missing Package: gcc-c++-3.4.6 (x86_64) Oracle 11g on Redhat Linux 6.2 More on orafaq.com
๐ŸŒ orafaq.com
February 23, 2021
linux - how to install gcc 4.9.2 on RHEL 7.4 - Stack Overflow
I am trying to install gcc and g++ 4.9.2 on Linux. I'm pretty new with Linux and i saw some guides of how to install, but each time I encountered with another problem. I don't have any gcc right no... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
Red Hat
access.redhat.com โ€บ discussions โ€บ 2076603
Red Hat Customer Portal - Access to 24x7 support and knowledge
December 5, 2015 - yum can be configured to try to resolve such errors by temporarily enabling disabled repos and searching for missing dependencies. To enable this functionality please set 'notify_only=0' in /etc/yum/pluginconf.d/search-disabled-repos.conf ยท Error: Package: libstdc++-devel-4.8.2-16.2.el7_0.x86_64 ...
๐ŸŒ
Oracle Communities
community.oracle.com โ€บ mosc โ€บ discussion โ€บ 4477014 โ€บ question-regarding-gcc-c-package
Question regarding gcc-c++ package โ€” oracle-mosc
October 6, 2020 - Currently I'm getting a warning ... Package "gcc-c++" is missing on node "amandajay01" - Cause: A required package is either not installed or, if the package is a kernel module, is not loaded on the specified node....
๐ŸŒ
GNU
gcc.gnu.org โ€บ gcc-4.8 โ€บ changes.html
GCC 4.8 Release Series โ€” Changes, New Features, and Fixes - GNU Project
When -g is used on a platform that uses DWARF debugging information, GCC will now default to -gdwarf-4 -fno-debug-types-section. GDB 7.5, Valgrind 3.8.0 and elfutils 0.154 debug information consumers support DWARF4 by default. Before GCC 4.8 the default version used was DWARF2. To make GCC 4.8 generate an older DWARF version use -g together with -gdwarf-2 or -gdwarf-3.
Find elsewhere
๐ŸŒ
Red Hat
bugzilla.redhat.com โ€บ show_bug.cgi
1723208 โ€“ The gcc-c++ cannot be installed on RHEL 7.7 ...
Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla ยท RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue ...
๐ŸŒ
GNU
gcc.gnu.org โ€บ releases.html
GCC Releases - GNU Project
April 30, 2026 - GCC releases may be downloaded from our mirror sites. Important: these are source releases, so will be of little use if you do not already have a C++ compiler installed. As one option, there are pre-compiled binaries.
๐ŸŒ
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.
๐ŸŒ
GNU
gcc.gnu.org โ€บ onlinedocs โ€บ 4.8.2
GCC 4.8.2 manuals - GNU Project
October 26, 2022 - GCC 4.8.2 Standard C++ Library Reference Manual (also in PDF or XML GPL or XML GFDL or an HTML tarball)
๐ŸŒ
CERN
root-forum.cern.ch โ€บ t โ€บ errors-when-compiling-using-custom-gcc-location โ€บ 19917
Errors when compiling using custom GCC location - ROOT - ROOT Forum
September 29, 2015 - Hello, I have had the somewhat unfortunate experience of trying to install ROOT on an older Centos 6.4 system which does not have the appropriate GCC version(s) needed to compile the latest versions of ROOT (gcc versions in its yum repo stop at 4.4.7), so I had to grab GCC 4.8.2 and compile it to a custom location on our network file system and point to it.
๐ŸŒ
GNU
gcc.gnu.org โ€บ onlinedocs โ€บ gcc-4.6.2 โ€บ gcc.pdf pdf
Using the GNU Compiler Collection
GCC 4.9.4 Standard C++ Library Reference Manual (also in PDF or XML GPL or XML GFDL or an HTML tarball) GCCGO 4.9.4 Manual (also in PDF or PostScript or an HTML tarball) GCC 4.9.4 GNU OpenMP Manual (also in PDF or PostScript or an HTML tarball) GCC 4.9.4 Quad-Precision Math Library Manual (also in PDF or PostScript or an HTML tarball) ... GCC 4.8...
๐ŸŒ
Oracle FAQ
orafaq.com โ€บ forum โ€บ t โ€บ 207438
OraFAQ Forum: Linux ยป Missing Package: gcc-c++-3.4.6 (x86_64)
February 23, 2021 - Expected Value : gcc-c++(x86_64)-3.4.6 Actual Value : missing Details: - PRVF-7532 : Package "gcc-c++(x86_64)" is missing on node "localhost" - Cause: A required package is either not installed or, if the package is a kernel module, is not loaded on the specified node.
๐ŸŒ
GNU
gcc.gnu.org โ€บ onlinedocs โ€บ gcc-4.8.5 โ€บ gcc.pdf pdf
Using the GNU Compiler Collection For gcc version 4.8.5 (GCC)
linking and startup. See Section 3.4 [Options Controlling C Dialect], page 30. GCC does not provide the library facilities required only of hosted implementations, nor
Top answer
1 of 4
22
yum install centos-release-scl-rh
yum install devtoolset-3-gcc devtoolset-3-gcc-c++
update-alternatives --install /usr/bin/gcc-4.9 gcc-4.9 /opt/rh/devtoolset-3/root/usr/bin/gcc 10
update-alternatives --install /usr/bin/g++-4.9 g++-4.9 /opt/rh/devtoolset-3/root/usr/bin/g++ 10
2 of 4
21

For installing the system compilers gcc, g++, the install command is # yum install gcc-c++ โ†’ Provides version 4.8.5 : /usr/bin/{ gcc, g++ }.

Other options: 1. gcc53-c++-5.3.0-1.el6.x86_64.rpm โ†’ https://drive.google.com/file/d/0B7S255p3kFXNRm9FVnZYUnhyZzg/view?usp=sharing&resourcekey=0-1N6zQa6Sbl_WycG1O9I7JA : Download and install : # cd Downloads/ && yum install ./gcc53-c++-5.3.0-1.el6.x86_64.rpm ..... Provides /usr/bin/{gcc53, g++53}.

  1. The devtoolsetยดs : https://www.softwarecollections.org/en/scls/rhscl/devtoolset-6/ โ†’ # yum-config-manager --enable rhel-server-rhscl-7-rpms

Install gcc, g++ version 4.9.2 : # yum install devtoolset-3-gcc-c++

Note : You can have as many gcc/g++ versions as you want, installed at the same time. ( The system compilers are a must.)


  1. gcc49-c++-4.9.3-1.el6.x86_64.rpm https://drive.google.com/file/d/1Pwq1ua80dGM72i7rpDNAIIdfcR1WK-hG/view?usp=sharing โ†’ Provides /usr/bin/{gcc49, g++49}.

  1. gcc63-c++-6.3.0-1.el7.x86_64.rpm https://drive.google.com/file/d/1t4WrgvpEP-6_NN3qMJhz9MS3CJhHrHKc/view?usp=sharing โ†’ Provides /usr/bin/{gcc63, g++63}.

  2. gcc45-c++-4.5.4-1.el7.x86_64.rpm https://drive.google.com/file/d/15aRg-BPhuyaEyZA9Jy-iAyC21_pwN7nD/view?usp=sharing โ†’ Provides /usr/bin/{gcc45, g++45, gfortran45}

  3. gcc42-c++-4.2.4-1.el6.x86_64.rpm https://drive.google.com/file/d/1eYWk6Nd63xeqqAUoJldNWRuwEGO6cAyv/view?usp=sharing โ†’ Provides /usr/bin/{gcc42, g++42}


  1. gcc73-c++-7.3.0-1.el7.x86_64.rpm https://drive.google.com/file/d/1PgwCP5tu8D0EJbJVTqJd7Vg8dJ4l4noi/view?usp=sharing โ†’ Provides /usr/bin/{gcc73, g++73}

  2. gcc48-c++-4.8.5-1.el6.x86_64.rpm https://drive.google.com/file/d/1w6fW6oSflDDYZt_cOpGj3QMEmzUC8Q9L/view?usp=sharing โ†’ Provides /usr/bin/{gcc48, g++48, gfortran48}

  3. gcc84-c++-8.4.0-1.el7.x86_64.rpm https://drive.google.com/file/d/1xgFtsiDi2uiB1B0AcOaSpxVizzET-pJf/view?usp=sharing โ†’ Provides /usr/bin/{gcc84, g++84, gfortran84}

๐ŸŒ
LinuxHostSupport
linuxhostsupport.com โ€บ home โ€บ how to install gcc on centos 7
How To Install GCC on CentOS 7 | LinuxHostSupport
May 24, 2019 - I followed the steps but when I check the version I got 4.8.5 instead of newer version. One of the user mentioned that we need to reload the files before Step-4. could you please provide the instructions on reloading the files ? ... We are not sure what the user is saying but if you want to have the latest version you can download the source manually just refer to step 3 on how to install it manually. ... I followed these instructions and installed gcc 12.2.0 on CentOS 7.9.