To use recent versions of compilers such as gcc 11 on centos stream, install the gcc toolsets, eg gcc-toolset-11 which is in the AppStream repos.

Answer from jiopaley on Stack Overflow
🌐
Rocky Linux Forum
forums.rockylinux.org › rocky linux help & support
How to install devtoolset-11-gcc-c++ \ - Rocky Linux Help & Support - Rocky Linux Forum
January 3, 2025 - Hello, Im having a hard time installing devtoolset-11-gcc-c++ on Rocky Linux 9. Can someone help me install it? thanks
Discussions

yum -y install devtoolset-11-* failing with `No package devtoolset-11-* available.`
Hello @nealef, It seems that devtoolset-11 has not been rebuild yet for clefos 7. Is this planned and if so, do you have an ETA on this ? This has been found when investigating pypa/manylinux#1266 ... More on github.com
🌐 github.com
3
January 29, 2022
mayeut/devtoolset-11 - Fedora Discussion
Description devtoolset-11 rebuild for centos 7 i686 Installation Instructions yum install devtoolset-11-binutils devtoolset-11-gcc [...] Active Releases The following unofficial repositories are provided as-is by owner of this project. Contact the owner directly for bugs or issues (IE: not ... More on discussion.fedoraproject.org
🌐 discussion.fedoraproject.org
0
January 29, 2022
Installing devtoolset-X
$ sudo dnf search toolset Last metadata expiration check: 2:26:13 ago on Mon 15 Nov 2021 05:10:30 AM EST. ============================================= Name & Summary Matched: toolset ==== gcc-toolset-10.x86_64 : Package that installs gcc-toolset-10 gcc-toolset-10-runtime.x86_64 : Package that handles gcc-toolset-10 Software Collection. gcc-toolset-11.x86_64 : Package that installs gcc-toolset-11 gcc-toolset-11-runtime.x86_64 : Package that handles gcc-toolset-11 Software Collection. gcc-toolset-9.x86_64 : Package that installs gcc-toolset-9 gcc-toolset-9-runtime.x86_64 : Package that handles gcc-toolset-9 Software Collection. So do dnf-install gcc-toolset-X, then scl enable devtoolset-X bash More on reddit.com
🌐 r/AlmaLinux
1
7
November 14, 2021
linux - How to permanently enable newer version of software installed from SCL repo? - Unix & Linux Stack Exchange
This was applicable on centos 6.8. Just a minor change to "source /opt/rh/devtoolset-3/enable" ... Just a late note on this: scl scl_source enable gcc-toolset-11 doesn't work in zsh, only bash -- something about arrays I think. More on unix.stackexchange.com
🌐 unix.stackexchange.com
December 25, 2014
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 11
Red Hat Developer Toolset | 11 | Red Hat Documentation
Release Notes for Red Hat Developer Toolset 11.0 · Installing and Using Red Hat Developer Toolset · Github · Youtube · Twitter · Developer resources · Cloud learning hub · Interactive labs · Training and certification · Customer support · See all documentation ·
🌐
GitHub
github.com › nealef › clefos › issues › 9
yum -y install devtoolset-11-* failing with `No package devtoolset-11-* available.` · Issue #9 · nealef/clefos
January 29, 2022 - This has been found when investigating pypa/manylinux#1266 CentOS 7 sources are available for devtoolset-11: https://vault.centos.org/centos/7/sclo/Source/rh/ The CentOS 7 x86_64 image is able to run the same commands as below successfully. ... docker pull s390x/clefos:7 docker run -it --rm s390x/clefos:7 echo "multilib_policy=best" >> /etc/yum.conf echo "skip_missing_names_on_install=False" >> /etc/yum.conf sed -i '/^override_install_langs=/d' /etc/yum.conf yum -y update yum -y install yum-utils curl yum-config-manager --enable extras yum -y install centos-release-scl-rh yum -y install devtoolset-11-binutils devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-gcc-gfortran
Author   nealef
🌐
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 - In Red Hat Developer Toolset, the GNU C++ compiler is provided by the devtoolset-11-gcc-c++ package and is automatically installed with the devtoolset-11-toolchain package as described in Section 1.5, “Installing Red Hat Developer Toolset”.
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 11 › html › user_guide › chap-red_hat_developer_toolset
Chapter 1. Red Hat Developer Toolset | User Guide | Red Hat Developer Toolset | 11 | Red Hat Documentation
Replace package_name with a space-separated list of packages that you want to install. For example, to install the devtoolset-11-gdb-gdbserver and devtoolset-11-gdb-doc packages:
🌐
Red Hat
access.redhat.com › documentation › en-us › red_hat_developer_toolset › 11 › html-single › 11.0_release_notes › index
11.0 Release Notes | Red Hat Developer Toolset | 11 | Red Hat Documentation
November 15, 2021 - Note that error messages related to a missing libitm library when using the -fgnu-tm option require the libitm package to be installed. You can install the package with the following command: ... To use the ccache utility with GCC included in Red Hat Developer Toolset, set your environment correctly. For example: ~]$ scl enable devtoolset-11 '/usr/lib64/ccache/gcc -c foo.c'
Find elsewhere
🌐
Fedora Discussion
discussion.fedoraproject.org › team workflows › projects in copr
mayeut/devtoolset-11 - Fedora Discussion
January 29, 2022 - Description devtoolset-11 rebuild for centos 7 i686 Installation Instructions yum install devtoolset-11-binutils devtoolset-11-gcc [...] Active Releases The following unofficial repositories are provided as-is by owner of this project.
🌐
Fedora
copr.fedorainfracloud.org › coprs › mayeut › devtoolset-11
mayeut/devtoolset-11 Copr
devtoolset-11 rebuild for centos 7 i686 · yum install devtoolset-11-binutils devtoolset-11-gcc [...] The following unofficial repositories are provided as-is by owner of this project. Contact the owner directly for bugs or issues (IE: not bugzilla). * Total number of downloaded packages.
🌐
Red Hat
docs.redhat.com › ja › documentation › red_hat_developer_toolset › 11 › pdf › user_guide › red_hat_developer_toolset-11-user_guide-ja-jp.pdf pdf
Red Hat Developer Toolset 11 ユーザーガイド Red Hat Developer Toolset のインストールと使用
December 7, 2025 - Red Hat Developer Toolset に含まれるすべてのコンポーネントをインストールするには、devtoolset- 11 パッケージをインストールします。
🌐
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
Red Hat Developer Toolset is distributed with GDB 11.2. This version is more recent than the version included in Red Hat Enterprise Linux and the previous release of Red Hat Developer Toolset and provides some enhancements and numerous bug fixes. In Red Hat Developer Toolset, the GNU Debugger is provided by the devtoolset-12-gdb package and is automatically installed with devtoolset-12-toolchain as described in Section 1.5, “Installing Red Hat Developer Toolset”.
🌐
Red Hat
docs.redhat.com › zh-cn › documentation › red_hat_developer_toolset › 11 › pdf › user_guide › Red_Hat_Developer_Toolset-11-User_Guide-zh-CN.pdf pdf
Red Hat Developer Toolset 11 用户指南 安装和使用 Red Hat Developer Toolset
要安装 Red Hat Developer Toolset 中包含的所有组件,请安装 devtoolset-11 软件包: · # yum install devtoolset-11 · 这会安装所有开发、调试和性能监控工具,以及系统的其他依赖软件包。另外,您可以选择只安装所 ·
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
🌐
GitHub
github.com › pypa › manylinux › issues › 1266
devtoolset-11 for manylinux_2014 · Issue #1266 · pypa/manylinux
January 27, 2022 - Last year we had the upgrade to devtoolset-10 for manylinux_2014 see #1141 and #1155. Now the devtoolset-11 is also released for CentOS 7. See below: https://centos.pkgs.org/7/centos-sclo-rh-x86_64/devtoolset-11-toolchain-11.0-3.el7.x86_...
Author   pypa
🌐
Centmin Mod
community.centminmod.com › threads › devtoolset-11-gcc-11-2-1.22340
Devtoolset-11 (GCC-11.2.1) | Centmin Mod Community Support Forums
June 8, 2022 - Community forum to allow Centmin Mod users to help each other in installing, using and extending the script.