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
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
How to install devtoolset-11-gcc-c++ \
Hello, Im having a hard time installing devtoolset-11-gcc-c++ on Rocky Linux 9. Can someone help me install it? thanks More on forums.rockylinux.org
🌐 forums.rockylinux.org
1
0
January 3, 2025
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
Recently Active 'devtoolset' Questions - Stack Overflow
When attempting to generate a large static library in a Fortran/C makefile-based project with devtoolset-11, the 'ar' step fails with: ar: first/object/in/alphabetical/order.o: file format not ... ... I run Centos 7, and I installed devtoolset-8 in order to get gcc 8. Here I found how to enable it ... More on stackoverflow.com
🌐 stackoverflow.com
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 › 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
🌐
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
🌐
Labri
lsd.labri.fr › buildtools
BuildTools - Labs in the Sky with Data
#print the current version of gcc $> gcc --version gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44) $> scl enable devtoolset-7 bash #in the new shell, prints the version of gcc $> gcc --version gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5) Software Collection devtoolset-11 provides version 11.2.1 of gcc.
Find elsewhere
🌐
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 › 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
# yum install devtoolset-11-gdb-gdbserver devtoolset-11-gdb-doc · To install debugging information for any of the Red Hat Developer Toolset packages, make sure that the yum-utils package is installed and run: ... Note that in order to use this command, you need to have access to the repository with these packages. 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.
🌐
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 ~]# scl enable devtoolset-7 bash [srv@local ~]# which gcc /opt/rh/devtoolset-7/root/usr/bin/gcc [srv@local ~]# gcc --version gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5) Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions.
🌐
Fedora
copr.fedorainfracloud.org › coprs › mayeut › devtoolset-11
mayeut/devtoolset-11 Copr
Additional buildroot packages: scl-utils-build, devtoolset-11-build, bash, bzip2, coreutils, cpio, diffutils, system-release, findutils, gawk, gcc, gcc-c++, grep, gzip, info, make, patch, redhat-rpm-config, rpm-build, sed, shadow-utils, tar, unzip, util-linux, which, xz · Build time repositories: http://mirror.centos.org/altarch/7/os/i386/, http://mirror.centos.org/altarch/7/updates/i386/ Build: 6736817 · State: succeeded · Finished: 2 years ago · #> dnf copr enable mayeut/devtoolset-11 More info about enabling Copr repositories ·
🌐
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
Consider the employee file from Example 11.1, “Using memstomp”. Run the strace utility on this executable file and trace only the mmap and munmap system calls: $ scl enable devtoolset-12 'strace -e mmap,munmap ./employee' mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f896c744000 mmap(NULL, 61239, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f896c735000 mmap(0x3146a00000, 3745960, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3146a00000 mmap(0x3146d89000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x189000) = 0x3146d89000 mmap(0x31
🌐
Stack Overflow
stackoverflow.com › questions › tagged › devtoolset
Recently Active 'devtoolset' Questions - Stack Overflow
When attempting to generate a large static library in a Fortran/C makefile-based project with devtoolset-11, the 'ar' step fails with: ar: first/object/in/alphabetical/order.o: file format not ... ... I run Centos 7, and I installed devtoolset-8 in order to get gcc 8. Here I found how to enable it for bash, which is done simply by adding source scl_source enable devtoolset-8 to .bashrc.
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_toolset › 10 › html-single › user_guide › index
User Guide | Red Hat Developer Toolset | 10 | Red Hat Documentation
Consider the employee file from Example 11.1, “Using memstomp”. Run the strace utility on this executable file and trace only the mmap and munmap system calls: $ scl enable devtoolset-10 'strace -e mmap,munmap ./employee' mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, ...