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
Discussions

When I use sudo command, it returns "Unable to open /etc/scl/prefixes/devtoolset-9!" - Unix & Linux Stack Exchange
My system is RHEL 6.7, Output of echo $PATH [geoeast@hp2-12 ~]$ which rm rm: aliased to rm -i [geoeast@hp2-12 ~]$ which cp cp: aliased to cp -i [geoeast@hp2-12 ~]$ echo $PATH /soft/geoeas... More on unix.stackexchange.com
🌐 unix.stackexchange.com
September 24, 2022
Scl enable devtoolset-7 bash on Rocky 9
I didn’t find scl or devtoolset-7 to install. How should I do? Thank you very much. More on forums.rockylinux.org
🌐 forums.rockylinux.org
16
0
March 9, 2023
Possibly wrong link order / devtoolset-8 libstdc++ unknown symbols
You are probably not going to like this one that much. It seems that bazel + binutils + gcc + redhats devtoolset-8 gets angry regarding -lstdc++, this appears to be related to https://bugzilla.redh... More on github.com
🌐 github.com
9
November 28, 2019
install issue on RHEL7
Hi, I have the same issue. i tired both but no luck, any idea · also i'm unable to login from the webpage (not sure if it for the same reason), I'm getting this error More on github.com
🌐 github.com
13
August 31, 2017
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 [ 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 [ {#_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
🌐
GitHub
github.com › bazelbuild › bazel › issues › 10327
Possibly wrong link order / devtoolset-8 libstdc++ unknown symbols · Issue #10327 · bazelbuild/bazel
November 28, 2019 - /opt/scl_enable" ./compile.sh · ... After a while bazel will fail to compile with some C++ linker error, normally complaining about some undefined symbol. The undef symbol will be something deep in libstdc++ Looking at a failed link, we find that bazel produces linker args something like so · -o bazel-out/host/bin/external/com_google_protobuf/protoc -Wl,-S -fuse-ld=gold -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/opt/rh/devtoolset-8/root/usr/bin -pass-exit-codes -lstdc++ -lm -Wl,--gc-sections bazel-out/host/bin/external/com_google_protobuf/_objs/protoc/main.o -Wl,--start-lib bazel-out/host/bin/external/com_google_protobuf/_objs/protoc_lib/code_generator.o SNIP SNIP %< ...
Author   bazelbuild
🌐
GitHub
gist.github.com › sub-mod › a79ee1c45a2d6ebefe815770f77a5656
glibc ABI issue · GitHub
glibc ABI issue. GitHub Gist: instantly share code, notes, and snippets.
🌐
Oracle
docs.oracle.com › en › operating-systems › oracle-linux › scl-user › scl-ReleaseNotes.html
Oracle Linux: Software Collection Library for Oracle Linux 7
January 2, 2025 - You should also exclude these packages ... the /etc/yum.conf file and updating the exclude option. Or, you can use the --exclude flag when running the yum command. ... When installing the devtoolset-3-libasan-devel-4.9.1-10.el7 package, which requires the libasan-4.9.1-10.el7 package, there is a potential dependency issue if the libasan-static-4.8.3-9.el7 package ...
Find elsewhere
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360004312319-enable-scl-devtoolset
enable scl devtoolset – IDEs Support (IntelliJ Platform) | JetBrains
1. I moved all my configuring code from .bashrc to .profile because (I don't remember exactly when) sometimes .bashrc was not applied to the environment. so for now devtoolset in .profile · 2. the command is "source scl_source enable devtoolset-4" .
🌐
NVIDIA
docs.nvidia.com › doca › archive › doca-v1.5.1 › troubleshooting › index.html
Troubleshooting Guide - NVIDIA Docs
Upgrading the devtoolset on the machine to the one used when building the gRPC package resolves the version conflict: ... $ sudo yum install epel-release $ sudo yum install centos-release-scl-rh $ sudo yum install devtoolset-8 $ sudo scl enable devtoolset-8 # This will enable the use of devtoolset-8 to the *current* bash session $ source /opt/rh/devtoolset-8/enable
🌐
Red Hat
access.redhat.com › solutions › 3090181
Why `scl enable` command shows error "Unable to open /etc/scl/prefixes/gcc!" ? - Red Hat Customer Portal
July 21, 2017 - On installation of devtoolset-4-gcc-c++ the scl enable gcc bash gives the following error. # scl enable gcc bash Unable to open /etc/scl/prefixes/gcc!
🌐
GitHub
github.com › MISP › MISP › issues › 2430
install issue on RHEL7 · Issue #2430 · MISP/MISP
August 31, 2017 - /var/tmp/sclaPcqKl: line 8: /var/www/MISP/app/Console/worker/start.sh: Permission denied ! [root@XXXX ~]# su -s /bin/bash apache -c 'scl enable rh-php56 bash -c /var/www/MISP/app/Console/worker/start.sh' Unable to open /etc/scl/conf/bash!
Author   MISP
🌐
Red Hat
access.redhat.com › discussions › 3279251
Red Hat Customer Portal - Access to 24x7 support and knowledge
January 4, 2018 - When executing scl command remote from other server cause error. Example ssh user1@server1.com scl enable rh-python36 'python /home/user1/setup.py install --user' cause error : Unable to open /etc/scl/conf/python!
🌐
GitHub
github.com › openssl › openssl › issues › 7982
Build fails on centos7 with devtoolset-7 · Issue #7982 · openssl/openssl
April 1, 2019 - The build of openssl 1.1.0 (and also 1.1.1) fails when devtoolset-7 is installed and enabled. Building 1.1.0 on a "vanilla" centos7 works. ... $ yum install -y centos-release-scl \ $ yum-config-manager --enable rhel-server-rhscl-7-rpms $ yum install -y devtoolset-7 $ source /opt/rh/devtoolset-7/enable
Author   openssl
🌐
Developer Community
developercommunity.visualstudio.com › t › linux-supportguide-for-redhat-devtoolset › 1617987
Linux Support/Guide for RedHat devtoolset
Skip to main content · Visual Studio · Guidelines Problems Suggestions Code of Conduct · Downloads · Visual Studio IDE Visual Studio Code Azure DevOps Team Foundation Server Accounts and Subscriptions · Subscriber Access · Microsoft Security Azure Dynamics 365 Microsoft 365 Microsoft ...
🌐
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.
🌐
NVIDIA
docs.nvidia.com › doca › archive › doca-v2-5-1 › NVIDIA+DOCA+Troubleshooting+Guide › index.html
NVIDIA DOCA Troubleshooting Guide - NVIDIA Docs
$ sudo yum install epel-release $ sudo yum install centos-release-scl-rh $ sudo yum install devtoolset-8 # This will enable the use of devtoolset-8 to the *current* bash session $ source /opt/rh/devtoolset-8/enable · When statically compiling against the DOCA SDK on RHEL 7.x machines, a known issue in the default pkg-config version (0.27) causes a linking error.
🌐
Openvino
blog.openvino.ai › blog-posts › build-openvino-tm-docker-image-on-centos-7
OpenVINO™ Blog | Build OpenVINO™ Docker Image on CentOS 7
December 13, 2022 - sudo -i echo “proxy=http://child-prc.intel.com:913” >> /etc/yum.conf exit sudo yum update sudo yum install gcc dnf centos-release-scl git wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh sudo chmod +x Anaconda3-2020.11-Linux-x86_64.sh ./Anaconda3-2020.11-Linux-x86_64.sh · Install docker on CentOS 7 and setup proxy (if any): ... wget https://cmake.org/files/v3.18/cmake-3.18.4-Linux-x86_64.tar.gz tar -xvf cmake-3.18.4-Linux-x86_64.tar.gz · sudo yum install devtoolset-8 source /opt/rh/devtoolset-8/enable conda create -n docker_py36 python=3.6 -y conda activate docker_py36 export PATH=/home/openvino/cmake-3.18.4-Linux-x86_64/bin:$PATH
🌐
GitHub
github.com › apache › trafficcontrol › issues › 5916
Building ATS: Unable to get file status /etc/scl/conf/devtoolset-7: No such file or directory · Issue #5916 · apache/trafficcontrol
June 4, 2021 - Pulling ats ... done Creating build_ats_run ... Creating build_ats_run ... done Building ats_build. Building ats_build [...] Creating _tsb_ats_build_run ... Creating _tsb_ats_build_run ... done Unable to get file status /etc/scl/conf/devtoolset-7: No such file or directory 3 Failed to build ats_build.
Author   apache