I am using CentOS 7.9 and I encountered the same problem after following instructions here to install and run gcc 11. I tried launching different versions of gcc and found only devtoolset-9 works, which corresponds to the file devtoolset-9 in /etc/scl/conf/ folder. So I copied devtoolset-9 to devtoolset-11 in the same folder, and gcc 11 gets working.

Answer from zzzhhh on Stack Overflow
🌐
Stack Overflow
stackoverflow.com › questions › 47415154 › my-installed-gcc-version-is-behind-my-installed-redhat-developer-toolset-version
c++ - My installed GCC version is behind my installed Redhat developer toolset version - Stack Overflow
Sign up to request clarification or add additional context in comments. ... '[--@-- ~]$ scl enable devtoolset-4 -- bash [--@-- ~]$ gcc --version gcc (GCC) 5.2.1 20150902 (Red Hat 5.2.1-2)' Wow that worked!! So will I have to run this every time to use the later gcc version?
Discussions

Can CMake automatically detect RH devtoolset-7?
I am building on Centos 7, which natively has gcc 4.8.5, using CMake 3.16.6 and Ninja. My code requires gcc 7 so I specify RH devtoolset-7: -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/g++ My code checks the compiler version as follows: if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") ... More on discourse.cmake.org
🌐 discourse.cmake.org
2
0
June 4, 2021
rhel - List packages in devtoolset - Unix & Linux Stack Exchange
Using Linux 2.6.32-504.8.1.el6.x86_64 #1 SMP Fri Dec 19 12:09:25 EST 2014 x86_64 x86_64 x86_64 GNU/Linux. I mean to get all packages in a devtoolset (or any other scl, actually). I tried (1) $ scl -l More on unix.stackexchange.com
🌐 unix.stackexchange.com
January 10, 2018
Newest 'devtoolset' Questions - Stack Overflow
I have installed the devtoolset-10 ... g++ --version I get this: g++ (GCC) 10.2.1 20210130 (Red Hat 10.2.1-... ... Note: This problem, which I have already solved, is a very different problem from every other similar question on Stack Overflow. I have posted this question and answer in the hopes that it will help ... ... I have boost 1.73 static libraries (.a) and RHEL devtoolset-10 installed,I do the following steps scl enable devtoolset-10 bash Check the LD_LIBRARY_PATH points to ... More on stackoverflow.com
🌐 stackoverflow.com
linux - How to permanently enable newer version of software installed from SCL repo? - Unix & Linux Stack Exchange
I would do sudo yum update && sudo yum install gcc and check gcc --version. If it's not 4.7, then you probably have to use devtoolset. If you don't want to run it in SCL, you can uninstall the native gcc with sudo yum remove gcc and then add the devtoolset directory to your path, i.e. More on unix.stackexchange.com
🌐 unix.stackexchange.com
December 25, 2014
🌐
Linux @ CERN
linux.web.cern.ch › devtoolset
Developer Toolset 3.0
wget -O /etc/yum.repos.d/slc5-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc5-devtoolset.repo
🌐
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 - Install the version(s) of your choice. Yes, they can co-exist. yum install devtoolset-10 · yum install devtoolset-9 · yum install devtoolset-8 · 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 it yourself with ·
🌐
CMake Discourse
discourse.cmake.org › usage
Can CMake automatically detect RH devtoolset-7? - Usage - CMake Discourse
June 4, 2021 - I am building on Centos 7, which natively has gcc 4.8.5, using CMake 3.16.6 and Ninja. My code requires gcc 7 so I specify RH devtoolset-7: -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/g++ My code checks the compiler version as follows: if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") ...
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360004312319-enable-scl-devtoolset
enable scl devtoolset – IDEs Support (IntelliJ Platform) | JetBrains
Look on the top right of the "Toolchains" window and you will see a "System" or "Remote Host" drop-down list. ... For your information the only thing devtoolset is doing for you is providing a newer version for C/C++ Compiler and other tools ...
🌐
Princeton CS Guide
csguide.cs.princeton.edu › software › gcc
GCC, the GNU Compiler Collection | Department of Computer Science Computing Guide
$ scl -l devtoolset-3 devtoolset-4 $ scl enable devtoolset-4 bash $ gcc --version gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) Copyright (C) 2015 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. ... Below is a check to determine if your forward and reverse DNS records match.
🌐
Stack Exchange
unix.stackexchange.com › questions › 416165 › list-packages-in-devtoolset
rhel - List packages in devtoolset - Unix & Linux Stack Exchange
January 10, 2018 - Installed Packages devtoolset-6-binutils.x86_64 2.27-10.el6.1 @/devtoolset-6-binutils-2.27-10.el6.1.x86_64 devtoolset-6-gcc.x86_64 6.3.1-3.1.el6 @/devtoolset-6-gcc-6.3.1-3.1.el6.x86_64 devtoolset-6-gcc-c++.x86_64 6.3.1-3.1.el6 @/devtoolset-6-gcc-c++-6.3.1-3.1.el6.x86_64 devtoolset-6-gcc-gdb-plugin.x86_64 6.3.1-3.1.el6 @/devtoolset-6-gcc-gdb-plugin-6.3.1-3.1.el6.x86_64 devtoolset-6-gcc-gfortran.x86_64 6.3.1-3.1.el6 @/devtoolset-6-gcc-gfortran-6.3.1-3.1.el6.x86_64 devtoolset-6-gcc-plugin-devel.x86_64 6.3.1-3.1.el6 @/devtoolset-6-gcc-plugin-devel-6.3.1-3.1.el6.x86_64 devtoolset-6-gdb.x86_64 7.12.
Find elsewhere
🌐
Iu
uisapp2.iu.edu › confluence-prd › pages › viewpage.action
How do I get new or updated software installed on the unified Linux systems? - Luddy School of Informatics, Computing, and Engineering KB - Indiana University Enterprise Confluence
September 28, 2010 - $ scl enable devtoolset-3 bash $ which gcc /opt/rh/devtoolset-3/root/usr/bin/gcc To get a list of new packages: (probably there is a better way??) $ rpm -qa devtoolset-3\* | sort devtoolset-3-3.0-15.el6.noarch devtoolset-3-ant-1.9.2-9.14.el6.noarch ... If you want to make this version the default for all logins you can add the appropriate scl command to your .bash_profile which is invoked on login.
🌐
Google Groups
groups.google.com › g › vfx-platform-discuss › c › _-_CPw1fD3c
Removal of Devtoolset-6 from CentOS 7.7
As was mentioned on the CentOS forums a while back, there has been a trimming of 'out-of-support' phase packages for the release of CentOS 7.7. For those using the distribution for their build systems, you will need to point a repo towards the previous version, 7.6.1810 (maybe through vault) to retrieve the packages through yum, or download the toolset packages from the following link: http://mirror.centos.org/centos-7/7.6.1810/sclo/x86_64/rh/devtoolset-6/
🌐
Stack Overflow
stackoverflow.com › questions › tagged › devtoolset
Newest 'devtoolset' Questions - Stack Overflow
I have installed the devtoolset-10 package on CentOS 7 and run the /opt/rh/devtoolset-10/enable script so that now when I do this: g++ --version I get this: g++ (GCC) 10.2.1 20210130 (Red Hat 10.2.1-... ... Note: This problem, which I have already solved, is a very different problem from every other similar question on Stack Overflow. I have posted this question and answer in the hopes that it will help ... ... I have boost 1.73 static libraries (.a) and RHEL devtoolset-10 installed,I do the following steps scl enable devtoolset-10 bash Check the LD_LIBRARY_PATH points to /opt/rh/devtoolset-10/root/usr/...
Top answer
1 of 5
93

In your ~/.bashrc or ~/.bash_profile Simply source the "enable" script provided with the devtoolset. For example, with the Devtoolset 2, the command is:

source /opt/rh/devtoolset-2/enable

or

source scl_source enable devtoolset-2

Lot more efficient: no forkbomb, no tricky shell

2 of 5
17

An alternative of source /opt/rh/devtoolset-4/enable is

source scl_source enable devtoolset-4

The above shell script scl_source is more elegant than using a hard coded path (may be different on another machine). However scl_source does less because /opt/rh/devtoolset-4/enable uses scl_source and other stuff.

To use scl_source you may have to upgrade package scl-utils

yum update scl-utils  # old scl-utils versions miss scl_source

Quick copy-paste

echo 'source scl_source enable devtoolset-4' >> ~/.bashrc
    # Do not forget to change the version ↑

Source code for curious people

An example of scl_source source code:
https://gist.github.com/bkabrda/6435016

The scl_source installed on my Red Hat 7.1

#!/bin/bash

_scl_source_help="Usage: source scl_source <action> [<collection> ...]

Don't use this script outside of SCL scriptlets!

Options:
    -h, --help    display this help and exit"

if [ $# -eq 0 -o $1 = "-h" -o $1 = "--help" ]; then
    echo "$_scl_source_help"
    return 0
fi


if [ -z "$_recursion" ]; then
    _recursion="false"
fi
if [ -z "$_scl_scriptlet_name" ]; then
    # The only allowed action in the case of recursion is the same
    # as was the original
    _scl_scriptlet_name=$1
fi
shift 1

if [ -z "$_scl_dir" ]; then
    # No need to re-define the directory twice
    _scl_dir=/etc/scl/conf
    if [ ! -e $_scl_dir ]; then
        _scl_dir=/etc/scl/prefixes
    fi
fi

for arg in "$@"; do
    _scl_prefix_file=$_scl_dir/$arg
    _scl_prefix=`cat $_scl_prefix_file 2> /dev/null`
    if [ $? -ne 0 ]; then
        echo "Can't read $_scl_prefix_file, $arg is probably not installed."
        return 1
    fi

    # First check if the collection is already in the list
    # of collections to be enabled
    for scl in ${_scls[@]}; do
        if [ $arg == $scl ]; then
            continue 2
        fi
    done

    # Now check if the collection isn't already enabled
    /usr/bin/scl_enabled $arg > /dev/null 2> /dev/null
    if [ $? -ne 0 ]; then
        _scls+=($arg)
        _scl_prefixes+=($_scl_prefix)
    fi;
done

if [ $_recursion == "false" ]; then
    _i=0
    _recursion="true"
    while [ $_i -lt ${#_scls[@]} ]; do
        _scl_scriptlet_path="${_scl_prefixes[$_i]}/${_scls[$_i]}/${_scl_scriptlet_name}"
        source "$_scl_scriptlet_path"
        if [ $? -ne 0 ]; then
            echo "Can't source $_scl_scriptlet_name, skipping."
        else
            export X_SCLS="${_scls[$_i]} $X_SCLS"
        fi;
        _i=$(($_i+1))
    done
    _scls=()
    _scl_prefixes=()
    _scl_scriptlet_name=""
    _recursion="false"
fi
🌐
Red Hat
access.redhat.com › documentation › en-us › red_hat_developer_toolset › 11 › html-single › user_guide › index
User Guide | Red Hat Developer Toolset | 11 | Red Hat Documentation
July 19, 2023 - If your system is registered with Red Hat Subscription Management, enable the rhel-variant-rhscl-version-debug-rpms repository as described in Section 1.4, “Getting Access to Red Hat Developer Toolset”. For more information on how to get access to debuginfo packages, see https://access.redhat.com/site/solutions/9907. ... The devtoolset-11-package_name-debuginfo packages can conflict with the corresponding packages from the base Red Hat Enterprise Linux system or from other versions of Red Hat Developer Toolset.
🌐
Developer Community
developercommunity.visualstudio.com › t › linux-supportguide-for-redhat-devtoolset › 1617987
Linux Support/Guide for RedHat devtoolset
Skip to main content · Microsoft · Visual Studio · Sign in · You need to enable JavaScript to run this app · Sorry this browser is no longer supported · Please use any other modern browser like 'Microsoft Edge'
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 10 › html › user_guide › chap-red_hat_developer_toolset
Chapter 1. Red Hat Developer Toolset | User Guide | Red Hat Developer Toolset | 10 | Red Hat Documentation
Retrieve repository metadata and to display a list of available Yum repositories: ... The repository names depend on the specific version of Red Hat Enterprise Linux you are using and are in the following format: rhel-variant-rhscl-version-rpms rhel-variant-rhscl-version-debug-rpms rhel-variant-rhscl-version-source-rpms · In addition, certain packages, such as devtoolset-10-gcc-plugin-devel, depend on packages that are only available in the Optional channel.
🌐
Softwarecollections
softwarecollections.org › en › scls › rhscl › devtoolset-8
Developer Toolset 8 — Software Collections
# 1. Install a package with repository for your system: # On CentOS, install package centos-release-scl available in CentOS repository: $ sudo yum install centos-release-scl # On RHEL, enable RHSCL repository for you system: $ sudo yum-config-manager --enable rhel-server-rhscl-7-rpms # 2. Install the collection: $ sudo yum install devtoolset-8 # 3. Start using software collections: $ scl enable devtoolset-8 bash · At this point you should be able to use gcc and other tools just as a normal application.
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 12 › html-single › user_guide › index
User Guide | Red Hat Developer Toolset | 12 | Red Hat Documentation
Retrieve repository metadata and to display a list of available Yum repositories: ... The repository names depend on the specific version of Red Hat Enterprise Linux you are using and are in the following format: rhel-variant-rhscl-version-rpms rhel-variant-rhscl-version-debug-rpms rhel-variant-rhscl-version-source-rpms · In addition, certain packages, such as devtoolset-12-gcc-plugin-devel, depend on packages that are only available in the Optional channel.
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 9 › html › 9.0_release_notes › dts9.0_release
Chapter 2. Red Hat Developer Toolset 9.0 Release | 9.0 Release Notes | Red Hat Developer Toolset | 9 | Red Hat Documentation
All components in Red Hat Developer ... with the devtoolset-9- prefix and only for Red Hat Enterprise Linux 7. The following components have been upgraded in Red Hat Developer Toolset 9.0 compared to the previous release of Red Hat Developer Toolset: ... In addition, Red Hat Developer Toolset 9.0 introduces a new component, Annobin, a build security checking ...
🌐
Posit Support
support.posit.co › hc › en-us › articles › 360006145413-RStudio-Workbench-RStudio-Server-Pro-with-devtoolset-enabled
Posit Workbench with devtoolset enabled – Posit Support
July 25, 2024 - system("gcc --version") Example output: gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2) Copyright (C) 2019 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. If you're using the Job Launcher to launch non-local sessions (using Slurm or Kubernetes), devtoolset ...