Install it by:

sudo yum install centos-release-scl
sudo yum install devtoolset-4

The first command installs and enables Software Collections Repository on your CentOS machine. That repository provides the devtoolset package.

Answer from 13dimitar on Stack Exchange
🌐
Stack Overflow
stackoverflow.com › questions › 53708189 › how-to-install-devtoolset-7-i686-on-centos-6
centos6 - How to install devtoolset-7 i686 on CentOS 6? - Stack Overflow
To install devtoolset-7.x86_64 on CentOS6 is pretty easy: yum install -y centos-release-scl yum install -y devtoolset-7-toolchain However, i686 is not available for download: http://mirror.centos....
Discussions

Install Obsolete Devtoolset Collection for CentOS - Stack Overflow
At present time Devtoolset-5 (and earlier) cannot be istalled from Software Collection Repository (centos-release-scl) using yum (only Devtoolset-6 and 7 are available). Nevertheless, this collecti... More on stackoverflow.com
🌐 stackoverflow.com
Where do I get "Development Tools" for CentOS 7 when trying to install via yum? - Unix & Linux Stack Exchange
I'm running CentOS 7. I want to install gcc (for the purposes of building Python 3 with the new openssl package I installed). I was reading here -- https://stackoverflow.com/questions/19816275/no- More on unix.stackexchange.com
🌐 unix.stackexchange.com
May 8, 2020
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
g++ - How can I install devtoolset on the workstation edition of RHEL7 - Stack Overflow
I would like to know how to install devtoolset on RHEL7 workstation. I found instructions for RHEL7 server which I have failed to adjust correctly for the workstation edition. I also found instruc... More on stackoverflow.com
🌐 stackoverflow.com
🌐
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 ...
🌐
Docker Hub
hub.docker.com › r › centos › devtoolset-6-toolchain-centos7
centos/devtoolset-6-toolchain-centos7 - Docker Image
docker run -ti --rm -v /src/app:/opt/app-root/src:z rhscl/devtoolset-6-toolchain-rhel7 bash bash-4.3$ gcc -o foo -ggdb -g2 foo.c Copy
🌐
Google Groups
groups.google.com › g › vfx-platform-discuss › c › _-_CPw1fD3c
Removal of Devtoolset-6 from CentOS 7.7
> > RUN yum install -y devtoolset-6 > See also this CentOS forum topic about missing devtoolkit-6 > > > On Wednesday, 18 September 2019 14:24:37 UTC+1, Aloys Baillet wrote:After some trial and error I have this method to install devtoolset-6 on CentOS-7.7:Add a repo file:/etc/yum.repos.d/d...
🌐
CentOS Repositories
centos.pkgs.org › 6 › centos-sclo-rh-x86_64 › devtoolset-7-7.0-8.el6.x86_64.rpm.html
devtoolset-7-7.0-8.el6.x86_64.rpm CentOS 6 Download
yum install centos-release-scl-rh · Install devtoolset-7 rpm package: # yum install devtoolset-7 · 2017-10-06 - Marek Polacek <polacek@redhat.com> - 7.0-8 - don't Require gcc for dockerfiles (#1499232) 2017-08-24 - Marek Polacek <polacek@redhat.com> - 7.0-7 - drop devtoolset-7-{all,go,llvm,rust} ...
Find elsewhere
🌐
CentOS Repositories
centos.pkgs.org › 6 › centos-sclo-rh-x86_64 › devtoolset-7-all-7.0-5.el6.x86_64.rpm.html
devtoolset-7-all-7.0-5.el6.x86_64.rpm CentOS 6 Download
devtoolset-7-all - Package shipping all available toolsets · Package shipping all available toolsets (GCC toolchain, perftools, Rust, LLVM, Go). Install CentOS SCLo RH repository: yum install centos-release-scl-rh · Install devtoolset-7-all rpm package: # yum install devtoolset-7-all ·
🌐
Abysm
blog.abysm.org › 2016 › 03 › installing-developer-toolset-rhel-based-distributions
Installing Developer Toolset on RHEL-based Distributions · Kuan-Yi Li's Blog
March 25, 2016 - yum install devtoolset-7 · yum install devtoolset-6 · yum install devtoolset-4 · yum install devtoolset-3 · Say you want to use Developer Toolset 8, you can run · scl enable devtoolset-10 bash · to invoke a BASH shell with environment variables setup to run Developer Toolset 10, check ...
🌐
LinuxTut
linuxtut.com › en › d19254039ce75aaf1e21
Steps to install devtoolset-6 on CentOS 7
November 2, 2020 - # yum -y install centos-release-scl # Fix as devtoolset-6 not in CentOS 7.7 mirrors sed -i 's/7/7.6.1810/g; s|^#\s*\(baseurl=http://\)mirror|\1vault|g; /mirrorlist/d' /etc/yum.repos.d/CentOS-SCLo-*.repo # yum install -y devtoolset-6
🌐
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 pack…
🌐
Readthedocs
lizardfs-docs.readthedocs.io › en › latest › devguide › creating_workspace.html
Setting up a development workspace — LizardFS Handbook latest documentation
sudo yum install cmake zlib-devel fuse-devel Judy-devel asciidoc libtool automake autoconf-2.69 rpm-build rpmlint a2x sudo yum install devtoolset-6 devtoolset-6-gcc-c++ devtoolset-6-libstdc++-devel · If you want to build the libisal2 stuff yurself, add yasm and nasm to the list: ... These ...
🌐
Red Hat
access.redhat.com › discussions › 3104201
Red Hat Customer Portal - Access to 24x7 support and knowledge
Furthermore, I have successfully enabled the following repositories: - rhel-6-desktop-optional-debug-rpms - rhel-6-desktop-optional-rpms - rhel-6-desktop-optional-source-rpms · However 'yum search devtoolset' yields no results, and 'yum install devtoolset-6' fails with "No package devtoolset-6 available".
🌐
GitHub
gist.github.com › 9fbed00315f5338c9fb1
Script to install devtoolset-based environment on Scientific Linux 6.x or CentOS 6.x · GitHub
September 20, 2019 - Script to install devtoolset-based environment on Scientific Linux 6.x or CentOS 6.x - install-build-system.sh
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.

Top answer
1 of 1
1

This issue in this case is RedHat subscription channels. Though the subscription and software are free (provided you have an active subscription already), for some reason you have to make a 'special request' to RedHat as per:

https://access.redhat.com/solutions/472793

You can automate this by visiting:

https://www.redhat.com/wapps/try/RHSCL

(when logged into the support portal). This should automatically be approved after which you can attach a new subscription. Identify the pool id using:

subscription-manager list --available --all

To find the pool id:

 Subscription Name:   Software Collections and Developer Toolset
 Provides:            Red Hat Developer Tools (for RHEL Server)
                      Red Hat Developer Tools Beta (for RHEL Workstation)
                      Red Hat Software Collections Beta (for RHEL Server)
                      Red Hat Software Collections Beta (for RHEL Workstation)
                      Red Hat Software Collections (for RHEL Server)
                      Red Hat Developer Tools Beta (for RHEL Server)
                      Red Hat Developer Toolset (for RHEL Workstation)
                      Red Hat Software Collections Beta (for RHEL Client)
                      Red Hat Software Collections (for RHEL Workstation)
                      Red Hat Developer Toolset (for RHEL Server)
                      Red Hat Developer Tools (for RHEL Workstation)
                      Red Hat Software Collections (for RHEL Client) 
SKU:                 foobar 
Contract:            1234 Pool ID: XXXXXXXXXX

Then attach this and enable the newly available repos:

>subscription-manager attach --pool=XXXXXXXXXXXXXXXXXXXX
Successfully attached a subscription for: Software Collections and Developer Toolset
>subscription-manager repos --enable rhel-workstation-rhscl-7-rpms
Repository 'rhel-workstation-rhscl-7-rpms' is enabled for this system.
>subscription-manager repos --enable rhel-7-workstation-devtools-rpms
Repository 'rhel-7-workstation-devtools-rpms' is enabled for this system.

You can now install freely:

>yum update -y 
>yum install -y devtoolset-7-gcc-c++

Quite why they make you jump through so many hoops is explained by RedHat as follows:

-If you have a 2013 RHEL SKU with Standard or Premium service level, there should be no action on your part, and your subscription should have full access to RHSCL.

-If you have a 2010 or older RHEL SKU with Standard or Premium service level, you should contact Red Hat Customer Service to request the RHSCL SKU (and all related content) added to your account.

NOTE: Developer Toolset is now included as part of Red Hat Software Collections. This change was made on May 29, 2014.

As you had Red Hat Enterprise Linux Workstation, Standard subscription which is older RHEL SKU with Standard service level, you had to initiate a special request for it

🌐
Centos
lists.centos.org › hyperkitty › list › announce@lists.centos.org › thread › 2APH7YUSNGVRJD5LAXBI46BBB5AKWHZZ
Announcing release of Developer Toolset 7 on CentOS Linux 7 x86_64 SCL - announce - lists.centos.org
I am pleased to announce the immediate ... QuickStart ---------- You can get started in three easy steps: $ sudo yum install centos-release-scl $ sudo yum install devtoolset-7 $ scl enable devtoolset-7 bash...