🌐
Linux Tips
linux-tips.com › programming
Installing gcc versions on Centos7 / Redhat7 - Programming - Linux Tips
September 20, 2018 - First of all enable software collections repo: sudo yum install centos-release-scl Now you can install gcc-6.x, gcc-7.x etc. with proper parameter like below: sudo yum install devtoolset-6-gcc* This ...
🌐
Wupingxin
blog.wupingxin.net › install-gcc-6-1-0-on-centos-7
Install gcc 6.1.0 on CentOS 7 – Wuping Xin Blog
August 7, 2020 - The default gcc on CentOS 7 is 4.8.5. Installing gcc 6.1 on CentOS 7 is not possible using yum install.
Discussions

Need to update gcc to version >=6 on CentOS 7 ? - Discuss - lists.centos.org
NFS Server on Centos 7.6.1810... More on lists.centos.org
🌐 lists.centos.org
Devtoolset 6 with gcc 6.3.1 on Centos 7.7
How do you guys get this version of devtoolset? Can’t find it. What already tried and did not worked is: yum install centos-release-scl yum-config-manager --enable rhel-s sudo yum install devtoolset-6 I get No package devtoolset-6 avalable. More on tech-artists.org
🌐 tech-artists.org
0
0
June 8, 2020
How to OFFLINE install GCC CC and C compiler in LINUX RHEL7.3
A local mirror repo is the best option in my opinion, as u/veive mentioned. You can use tools like reposync to pull down a mirror of active repos to the local machine, and transfer this mirror either to the machine you're wanting to install GCC on or make it available on the same network. Repo URLs do not need to be remote, file URLs are completely valid. This means you can either use a local reposync'd copy made earlier or mounted installation media. If you have installation media for RHEL with the packages you want on it (anything but the minimal and netboot images should work for GCC), you can just point repo configs to their local paths. Some people discussing reposync on CentOS: https://www.centos.org/forums/viewtopic.php?t=61184 Installing from the repos on DVD installation media with RHEL: https://access.redhat.com/solutions/1355683 Using reposync with a RH support subscription (RHN): http://casesup.com/create-a-local-mirror-of-the-latest-update-for-red-hat-enterprise-linux-without-satellite/ A last ditch option if this proves too complex is to just work out the installation RPMs and their dependencies manually, transfer them into your isolated environment and install them directly with yum or rpm - neither tool needs an actual repository to work with, you can just give them a list of pre-downloaded package files to install. This is a fairly manual and annoying process. More on reddit.com
🌐 r/linuxquestions
25
3
September 5, 2018
Devtoolset is a game changer for C++ development on Linux

what is devtoolset ?

More on reddit.com
🌐 r/cpp
31
20
March 23, 2018
🌐
Blogger
devlucidmaj7.blogspot.com › 2020 › 04 › installing-centos7-gcc-6x.html
Installing CentOS7 GCC 6.x
April 22, 2020 - Installing CentOS7 GCC 6.x Installing GCC on CentOS 7 will install version 4.8.5. In some cases, you may need to install a higher versio...
🌐
LinuxHostSupport
linuxhostsupport.com › home › how to install gcc on centos 7
How To Install GCC on CentOS 7 | LinuxHostSupport
May 24, 2019 - First of all log in to your CentOS 7 VPS via SSH as user root ... GCC can be easily installed from the official CentOS repositories.
🌐
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 - Use the yum command as follows: ##[ CentOS 7 ] ## $ sudo yum install man-pages man-db man ##[ CentOS 6.x ] ## $ sudo yum install man man-pages · You learned how to install GNU c, c++ compilers and releated tools on a CentOS or Red Hat Enterprise Linux version 7.x. See GCC site for more info.
🌐
Bobsteagall
bobsteagall.com › 2017 › 12 › 30 › gcc-builder
Building GCC on Linux – The State Machine
December 30, 2017 - In order to use your new compiler installation, some path variables need to be adjusted. The simplest way to do this is source the setenv-for-gcc720.sh script that was created with the compiler and installed into /usr/local/bin. Option A: Source the script /usr/local/bin/setenv-for-gcc-720.sh, ...
🌐
Serverkurma
serverkurma.com › linux › how-to-install-newer-version-of-gcc-on-centos-6-x
How To Install Newer Version Of GCC on CentOS 6.x – ServerKurma – Bilişim Hizmetleri
7. We are building ! This could take hours depending on how man cpu you have. If this thing goes smoothly we will see “finished” as a last line. It is normal to see some error like messages. We will use different directory to compile this because it is better way to do it. cd .. mkdir gcc_6_1_0_release-build/ cd gcc_6_1_0_release-build/ ../gcc_6_1_0_release-build/configure && make && sudo make install && echo "finished" --- If your VPS has multiple CPU cores, you can speed up this progress by changing the middle part of the code --- change line from "&& make &&" to "&& make -j <number of CPU cores> &&".
Find elsewhere
🌐
techsathi
techsathi.wordpress.com › 2016 › 09 › 13 › installing-gcc-6-1-on-centos-7
Installing gcc 6.1 on centos 7 - techsathi - WordPress.com
September 13, 2016 - Installing gcc 6.1 on centos 7 is not possible using yum install. It requires a bit long process for successful installation. A step by step guide for installation of gcc 6.1 on centos 7 is given below: yum install libmpc-devel mpfr-devel gmp-devel ...
🌐
Medium
bipulkkuri.medium.com › install-latest-gcc-on-centos-linux-release-7-6-a704a11d943d
Install latest GCC on Centos Linux release 7.6
August 18, 2020 - ... And all scripts together. sudo ... ../gcc-8.2.0/configure --enable-languages=c,c++ --disable-multilib make -j$(nproc) sudo make install gcc --version...
🌐
Centos
lists.centos.org › hyperkitty › list › discuss@lists.centos.org › thread › GYWBBM7QIICFFQGBLNCU2Y3PQB4VLVX2
Need to update gcc to version >=6 on CentOS 7 ? - Discuss - lists.centos.org
I need to build u-boot on my CentOS 7 machine but encounter this: ... *** Your GCC is older than 6.0 and is not supported · I've updated the installation on my machine but the current version is: ... gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) How do I go about updating gcc to version 6 or greater on my CentOS 7 machine?
🌐
Ahelpme
ahelpme.com › home › linux › centos 7 › how to install new gcc and development tools under centos 7
How to install new gcc and development tools under CentOS 7 | Any IT here? Help Me!
September 5, 2019 - [srv@local ~]# yum install devtoolset-7-gcc* Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.crazyfrogs.org * extras: centos.quelquesmots.fr * updates: centos.mirror.fr.planethoster.net centos-sclo-rh | 3.0 kB 00:00:00 centos-sclo-sclo | 2.9 kB 00:00:00 ...
🌐
CyberITHub
cyberithub.com › install-gcc-and-c-compiler
Easy Steps to Install GCC(C and C++ Compiler) on CentOS 7 | CyberITHub
January 18, 2020 - In this article I will take you through the steps to install GCC on CentOS 7. As per GCC Document ,The GNU Compiler Collection includes front ends for C, C++,
🌐
Blogger
linuxbj.blogspot.com › 2016 › 08 › how-to-install-gcc-6-in-centos-rhel.html
Linux Admin Tech Forum: How to install gcc-6 in CentOS / RHEL Server
August 5, 2016 - [root@server1 ~]# mkdir build ... command runs 4 hours for me in 16GB RAM, 4 core Intel Xeon Server. It depends on ur machine config. [root@server1 ~]# make install That's it....
Top answer
1 of 2
16

I've confirmed that you can upgrade gcc from the default version 4.8 on centOS 7.

First, we need to install "Software Collections" in order to access some of the community packages including gcc v7

  • sudo yum install -y centos-release-scl

Next, we want to install a developer toolset. Depending on your needs, you may want a different devtoolset. Here I'm targeting 7:

  • sudo yum install -y devtoolset-7

Finally, you'll want to change over to gcc 7 as your default, launch a new shell session with the scl tool:

  • scl enable devtoolset-7 bash
2 of 2
1

Enable the software collection in the answer is only effective in the current shell. The scl utility will create a "child-shell" that set the PATH variables properly, so that in the new child-shell, the enabled software collections will be firstly searched. These settings obviously only take effective temporarily in the current shell.

To make it permanently effective, add the command, source /opt/rh/devtoolset-7/enable to the user's profile (~/.bash_profile or ~/.bashrc for RHEL based OS, like CentOS 7). Then, start a new shell and you will have the right tools available.

After execute scl enable devtoolset-7 bash, you will need to execute exit twice to exit the opened shell window, which verifies that the scl command created a new shell instance as a child process. There might be side-effect with creating a child-shell, so do not put this command in the ~/.bashrc profile, otherwise it will repeatedly create child-shell (non-login shell) as each shell will load the profile, resulting in a endless recursive loop. Put it in ~/.bash_profile, it will be loaded for only once (for the login shell), but you will need to exit twice every time.

But for development purpose, scl enable devtoolset-7 bash would be preferred, as you can exit the created child-shell, and then switch between different versions of the same software.


More details about the GCC version in python terminal:

The version info of the built-in Python in CentOS 7:

[root@conda condabuilder]# python
Python 2.7.5 (default, Nov 16 2020, 22:23:17) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

The version info of the user installed (via conda) Python on a system even without higher version of GCC installed:

[root@conda condabuilder]# conda activate jupyter
(jupyter) [root@conda condabuilder]# python -VV
Python 3.10.9 | packaged by conda-forge | (main, Feb  2 2023, 20:20:04) [GCC 11.3.0]

From the results, we can see that the GCC version contained in Python's version info is not related to the system's GCC. The system's default Python (2.7.5) should have been compiled with the GCC version distributed with CentOS 7, so the version info show the same GCC version. But for user installed python, the GCC version info actually depends on what version of GCC is used for building and packging the python binary.

🌐
Serverkurma
serverkurma.com › linux › how-to-install-and-update-gcc-on-centos-7
How to install and update GCC on Centos 7 – ServerKurma – Bilişim Hizmetleri
February 19, 2018 - You must made a change for centos 7. Only one difference is at 7 step when you are compiling GCC. ... ../gcc-6.1.0/configure –enable-languages=c,c++ –disable-multilib && make -j <number of CPU cores> && sudo make install && echo “success”
🌐
Tech-Artists.Org
tech-artists.org › coding
Devtoolset 6 with gcc 6.3.1 on Centos 7.7 - Coding - Tech-Artists.Org
June 8, 2020 - How do you guys get this version of devtoolset? Can’t find it. What already tried and did not worked is: yum install centos-release-scl yum-config-manager --enable rhel-s sudo yum install devtoolset-6 I get No package devtoolset-6 avalable.
🌐
jdhao's digital space
jdhao.github.io › 2017 › 09 › 04 › install-gcc-newer-version-on-centos
How to Compile and Install Latest Version of GCC on CentOS 7 · jdhao's digital space
April 20, 2019 - We need to install 3 dependencies packages. It is recommended to install these packages through yum. ... Unlike other packages, it is recommended to create another build directory outside of the GCC source directory to build GCC.