CentOS gcc introduction and quick upgrade

1.gcc introduction

GCC (GNU Compiler Collection) is an open source compiler suite developed and maintained by the GNU ( recursive abbreviation for GNU 's Not Unix!) project. It is a powerful and widely used compiler that supports many programming languages, including C, C++, Objective-C, Fortran, Ada, and several others.

On CentOS, GCC is the default compiler suite, which provides a set of tools and libraries for compiling source code into executable programs, library files, or other object files. Here is some important information about GCC:

  • Version: GCC's version number is updated over time. Each version brings new features, performance improvements, and bug fixes. You can use the gcc --version command to view the installed GCC version.
  • Supported languages: GCC supports a variety of programming languages, including C, C++, Objective-C, Fortran, Ada, Go, and others. By using different commands like gcc, g++, gfortran, etc. you can choose to compile a specific language.
  • Compilation options: GCC provides a wide range of compilation options to control the behavior of the compilation process. You can use these options to specify optimization levels, debugging information, warning levels, target architecture, and more.
  • Standard library: GCC comes with a set of standard libraries, including C standard library (libc), C++ standard library (libstdc++), etc. These libraries provide a variety of commonly used functions and data structures that developers can use in their programs.
  • Extensions: GCC provides many extensions to support specific language features or platform-specific functionality. These extensions can be enabled or disabled via compile options.

GCC is a powerful and flexible compiler suite that is widely used to develop various types of applications and system software. As the default compiler in CentOS, it provides rich functions and extensive language support, allowing developers to compile and build various projects

2.gcc quick upgrade

The main reason for many compilation problems is that the current gcc version does not match. Upgrading to the required gcc version can solve the problem.

To upgrade your GCC version on CentOS, you can use the following steps:

  • Update system:

First, make sure your system is updated to the latest version. Run the following command to update the CentOS package list and installed packages:

sudo yum update

This will update your system and install the latest packages.

  • Install Devtoolset:

CentOS provides a collection of software called Devtoolset, which includes newer versions of GCC. You can install Devtoolset using the following command:

sudo yum install centos-release-scl
sudo yum install devtoolset-<version>

<version> is the version number of Devtoolset you want to install. For example, if you want to install Devtoolset-9, replace <version> with 9.

  • Enable Devtoolset:

After the installation is complete, use the following command to enable the installed version of Devtoolset:

scl enable devtoolset-<version> bash


This will enable Devtoolset in the current terminal session, setting the new GCC version as the default.

  • Verify GCC version:

Run the following command to verify the installed GCC version:

gcc --version

If the new version number you installed is displayed, the upgrade was successful.

  • Enable Devtoolset settings:

Note that newer versions of GCC are provided with Devtoolset, but need to be explicitly enabled when using them. This means that if you open a new terminal window in a new terminal session, you will no longer use the version of GCC provided by Devtoolset. You can enable Devtoolset again by running the scl enable devtoolset-<version> bash command. If you want to use a new version of GCC in every new terminal window, you can add the enable command scl enable devtoolset-<version> bash to your shell profile (such as ~/.bashrc or ~/.bash_profile).

Additionally, upgrading GCC may have an impact on the system and other software packages. Make sure to back up important data before upgrading and test after the upgrade to ensure all applications and dependencies are still working properly.

  • Installation process output:
[xxx]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
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.

[xxx]# yum install devtoolset-11
Loaded plugins: fastestmirror, langpacks, nvidia
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                               |  15 kB  00:00:00

base                                                                                                                               | 3.6 kB  00:00:00
centos-sclo-rh                                                                                                                     | 3.0 kB  00:00:00
centos-sclo-sclo                                                                                                                   | 3.0 kB  00:00:00
cuda-rhel7-x86_64                                                                                                                  | 3.0 kB  00:00:00
docker-ce-stable                                                                                                                   | 3.5 kB  00:00:00
epel                                                                                                                               | 4.7 kB  00:00:00
extras                                                                                                                             | 2.9 kB  00:00:00
libnvidia-container/x86_64/signature                                                                                               |  833 B  00:00:00
libnvidia-container/x86_64/signature                                                                                               | 2.1 kB  00:00:00 !!!
nvidia-container-runtime/x86_64/signature                                                                                          |  833 B  00:00:00
nvidia-container-runtime/x86_64/signature                                                                                          | 2.1 kB  00:00:00 !!!
nvidia-docker/x86_64/signature                                                                                                     |  833 B  00:00:00
nvidia-docker/x86_64/signature                                                                                                     | 2.1 kB  00:00:00 !!!
updates                                                                                                                            | 2.9 kB  00:00:00
cuda-rhel7-x86_64/primary_db                                                                                                       | 2.1 MB  00:00:02
Resolving Dependencies
--> Running transaction check
---> Package devtoolset-11.x86_64 0:11.1-2.el7 will be installed
--> Processing Dependency: devtoolset-11-perftools for package: devtoolset-11-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-runtime for package: devtoolset-11-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-toolchain for package: devtoolset-11-11.1-2.el7.x86_64
--> Running transaction check
---> Package devtoolset-11-perftools.x86_64 0:11.1-2.el7 will be installed
--> Processing Dependency: devtoolset-11-systemtap for package: devtoolset-11-perftools-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-valgrind for package: devtoolset-11-perftools-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-oprofile for package: devtoolset-11-perftools-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-dyninst for package: devtoolset-11-perftools-11.1-2.el7.x86_64
---> Package devtoolset-11-runtime.x86_64 0:11.1-2.el7 will be installed
---> Package devtoolset-11-toolchain.x86_64 0:11.1-2.el7 will be installed
--> Processing Dependency: devtoolset-11-gcc for package: devtoolset-11-toolchain-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-gcc-c++ for package: devtoolset-11-toolchain-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-gcc-gfortran for package: devtoolset-11-toolchain-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-binutils for package: devtoolset-11-toolchain-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-gdb for package: devtoolset-11-toolchain-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-strace for package: devtoolset-11-toolchain-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-dwz for package: devtoolset-11-toolchain-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-elfutils for package: devtoolset-11-toolchain-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-ltrace for package: devtoolset-11-toolchain-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-make for package: devtoolset-11-toolchain-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-annobin for package: devtoolset-11-toolchain-11.1-2.el7.x86_64
--> Processing Dependency: devtoolset-11-memstomp for package: devtoolset-11-toolchain-11.1-2.el7.x86_64
--> Running transaction check
---> Package devtoolset-11-annobin-docs.noarch 0:10.38-1.el7 will be installed
---> Package devtoolset-11-binutils.x86_64 0:2.36.1-1.el7.2 will be installed
---> Package devtoolset-11-dwz.x86_64 0:0.14-2.el7 will be installed
---> Package devtoolset-11-dyninst.x86_64 0:11.0.0-1.el7 will be installed
---> Package devtoolset-11-elfutils.x86_64 0:0.185-2.el7 will be installed
--> Processing Dependency: devtoolset-11-elfutils-debuginfod-client(x86-64) = 0.185-2.el7 for package: devtoolset-11-elfutils-0.185-2.el7.x86_64
--> Processing Dependency: devtoolset-11-elfutils-libelf(x86-64) = 0.185-2.el7 for package: devtoolset-11-elfutils-0.185-2.el7.x86_64
--> Processing Dependency: devtoolset-11-elfutils-libs(x86-64) = 0.185-2.el7 for package: devtoolset-11-elfutils-0.185-2.el7.x86_64
--> Processing Dependency: libdw.so.dts.1(ELFUTILS_0.177)(64bit) for package: devtoolset-11-elfutils-0.185-2.el7.x86_64
---> Package devtoolset-11-gcc.x86_64 0:11.2.1-9.1.el7 will be installed
---> Package devtoolset-11-gcc-c++.x86_64 0:11.2.1-9.1.el7 will be installed
--> Processing Dependency: devtoolset-11-libstdc++-devel = 11.2.1-9.1.el7 for package: devtoolset-11-gcc-c++-11.2.1-9.1.el7.x86_64
---> Package devtoolset-11-gcc-gfortran.x86_64 0:11.2.1-9.1.el7 will be installed
--> Processing Dependency: devtoolset-11-libquadmath-devel = 11.2.1-9.1.el7 for package: devtoolset-11-gcc-gfortran-11.2.1-9.1.el7.x86_64
---> Package devtoolset-11-gdb.x86_64 0:10.2-6.el7 will be installed
---> Package devtoolset-11-ltrace.x86_64 0:0.7.91-1.el7 will be installed
---> Package devtoolset-11-make.x86_64 1:4.3-1.el7 will be installed
---> Package devtoolset-11-memstomp.x86_64 0:0.1.5-6.el7 will be installed
---> Package devtoolset-11-oprofile.x86_64 0:1.4.0-2.el7 will be installed
---> Package devtoolset-11-strace.x86_64 0:5.13-3.3.el7 will be installed
---> Package devtoolset-11-systemtap.x86_64 0:4.5-7.el7 will be installed
--> Processing Dependency: devtoolset-11-systemtap-client = 4.5-7.el7 for package: devtoolset-11-systemtap-4.5-7.el7.x86_64
--> Processing Dependency: devtoolset-11-systemtap-devel = 4.5-7.el7 for package: devtoolset-11-systemtap-4.5-7.el7.x86_64
---> Package devtoolset-11-valgrind.x86_64 1:3.17.0-4.el7 will be installed
--> Running transaction check
---> Package devtoolset-11-elfutils-debuginfod-client.x86_64 0:0.185-2.el7 will be installed
---> Package devtoolset-11-elfutils-libelf.x86_64 0:0.185-2.el7 will be installed
---> Package devtoolset-11-elfutils-libs.x86_64 0:0.185-2.el7 will be installed
---> Package devtoolset-11-libquadmath-devel.x86_64 0:11.2.1-9.1.el7 will be installed
---> Package devtoolset-11-libstdc++-devel.x86_64 0:11.2.1-9.1.el7 will be installed
---> Package devtoolset-11-systemtap-client.x86_64 0:4.5-7.el7 will be installed
--> Processing Dependency: devtoolset-11-systemtap-runtime = 4.5-7.el7 for package: devtoolset-11-systemtap-client-4.5-7.el7.x86_64
---> Package devtoolset-11-systemtap-devel.x86_64 0:4.5-7.el7 will be installed
--> Processing Dependency: elfutils-devel for package: devtoolset-11-systemtap-devel-4.5-7.el7.x86_64
--> Running transaction check
---> Package devtoolset-11-systemtap-runtime.x86_64 0:4.5-7.el7 will be installed
---> Package elfutils-devel.x86_64 0:0.176-5.el7 will be installed
--> Processing Dependency: pkgconfig(liblzma) for package: elfutils-devel-0.176-5.el7.x86_64
--> Running transaction check
---> Package xz-devel.x86_64 0:5.2.2-2.el7_9 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================================================================
 Package                                                   Arch                    Version                          Repository                       Size
==========================================================================================================================================================
Installing:
 devtoolset-11                                             x86_64                  11.1-2.el7                       centos-sclo-rh                  5.7 k
Installing for dependencies:
 devtoolset-11-annobin-docs                                noarch                  10.38-1.el7                      centos-sclo-rh                  107 k
 devtoolset-11-binutils                                    x86_64                  2.36.1-1.el7.2                   centos-sclo-rh                  6.3 M
 devtoolset-11-dwz                                         x86_64                  0.14-2.el7                       centos-sclo-rh                  118 k
 devtoolset-11-dyninst                                     x86_64                  11.0.0-1.el7                     centos-sclo-rh                  4.3 M
 devtoolset-11-elfutils                                    x86_64                  0.185-2.el7                      centos-sclo-rh                  432 k
 devtoolset-11-elfutils-debuginfod-client                  x86_64                  0.185-2.el7                      centos-sclo-rh                   58 k
 devtoolset-11-elfutils-libelf                             x86_64                  0.185-2.el7                      centos-sclo-rh                  214 k
 devtoolset-11-elfutils-libs                               x86_64                  0.185-2.el7                      centos-sclo-rh                  266 k
 devtoolset-11-gcc                                         x86_64                  11.2.1-9.1.el7                   centos-sclo-rh                   32 M
 devtoolset-11-gcc-c++                                     x86_64                  11.2.1-9.1.el7                   centos-sclo-rh                   12 M
 devtoolset-11-gcc-gfortran                                x86_64                  11.2.1-9.1.el7                   centos-sclo-rh                   13 M
 devtoolset-11-gdb                                         x86_64                  10.2-6.el7                       centos-sclo-rh                  3.9 M
 devtoolset-11-libquadmath-devel                           x86_64                  11.2.1-9.1.el7                   centos-sclo-rh                  180 k
 devtoolset-11-libstdc++-devel                             x86_64                  11.2.1-9.1.el7                   centos-sclo-rh                  3.6 M
 devtoolset-11-ltrace                                      x86_64                  0.7.91-1.el7                     centos-sclo-rh                  134 k
 devtoolset-11-make                                        x86_64                  1:4.3-1.el7                      centos-sclo-rh                  515 k
 devtoolset-11-memstomp                                    x86_64                  0.1.5-6.el7                      centos-sclo-rh                  443 k
 devtoolset-11-oprofile                                    x86_64                  1.4.0-2.el7                      centos-sclo-rh                  1.8 M
 devtoolset-11-perftools                                   x86_64                  11.1-2.el7                       centos-sclo-rh                  3.1 k
 devtoolset-11-runtime                                     x86_64                  11.1-2.el7                       centos-sclo-rh                   20 k
 devtoolset-11-strace                                      x86_64                  5.13-3.3.el7                     centos-sclo-rh                  1.3 M
 devtoolset-11-systemtap                                   x86_64                  4.5-7.el7                        centos-sclo-rh                   15 k
 devtoolset-11-systemtap-client                            x86_64                  4.5-7.el7                        centos-sclo-rh                  3.7 M
 devtoolset-11-systemtap-devel                             x86_64                  4.5-7.el7                        centos-sclo-rh                  2.3 M
 devtoolset-11-systemtap-runtime                           x86_64                  4.5-7.el7                        centos-sclo-rh                  437 k
 devtoolset-11-toolchain                                   x86_64                  11.1-2.el7                       centos-sclo-rh                  3.3 k
 devtoolset-11-valgrind                                    x86_64                  1:3.17.0-4.el7                   centos-sclo-rh                   11 M
 elfutils-devel                                            x86_64                  0.176-5.el7                      base                             90 k
 xz-devel                                                  x86_64                  5.2.2-2.el7_9                    updates                          46 k

Transaction Summary
==========================================================================================================================================================
Install  1 Package (+29 Dependent packages)

Total download size: 99 M
Installed size: 292 M
Is this ok [y/d/N]: y
Downloading packages:
(1/30): devtoolset-11-11.1-2.el7.x86_64.rpm                                                                                        | 5.7 kB  00:00:00
(2/30): devtoolset-11-annobin-docs-10.38-1.el7.noarch.rpm                                                                          | 107 kB  00:00:00
(3/30): devtoolset-11-dwz-0.14-2.el7.x86_64.rpm                                                                                    | 118 kB  00:00:00
(4/30): devtoolset-11-binutils-2.36.1-1.el7.2.x86_64.rpm                                                                           | 6.3 MB  00:00:01
(5/30): devtoolset-11-dyninst-11.0.0-1.el7.x86_64.rpm                                                                              | 4.3 MB  00:00:01
(6/30): devtoolset-11-elfutils-debuginfod-client-0.185-2.el7.x86_64.rpm                                                            |  58 kB  00:00:00
(7/30): devtoolset-11-elfutils-0.185-2.el7.x86_64.rpm                                                                              | 432 kB  00:00:00
(8/30): devtoolset-11-elfutils-libelf-0.185-2.el7.x86_64.rpm                                                                       | 214 kB  00:00:00
(9/30): devtoolset-11-elfutils-libs-0.185-2.el7.x86_64.rpm                                                                         | 266 kB  00:00:00
(10/30): devtoolset-11-gcc-c++-11.2.1-9.1.el7.x86_64.rpm                                                                           |  12 MB  00:00:02
(11/30): devtoolset-11-gcc-gfortran-11.2.1-9.1.el7.x86_64.rpm                                                                      |  13 MB  00:00:03
(12/30): devtoolset-11-gdb-10.2-6.el7.x86_64.rpm                                                                                   | 3.9 MB  00:00:00
(13/30): devtoolset-11-gcc-11.2.1-9.1.el7.x86_64.rpm                                                                               |  32 MB  00:00:06
(14/30): devtoolset-11-libquadmath-devel-11.2.1-9.1.el7.x86_64.rpm                                                                 | 180 kB  00:00:00
(15/30): devtoolset-11-ltrace-0.7.91-1.el7.x86_64.rpm                                                                              | 134 kB  00:00:00
(16/30): devtoolset-11-make-4.3-1.el7.x86_64.rpm                                                                                   | 515 kB  00:00:00
(17/30): devtoolset-11-libstdc++-devel-11.2.1-9.1.el7.x86_64.rpm                                                                   | 3.6 MB  00:00:00
(18/30): devtoolset-11-memstomp-0.1.5-6.el7.x86_64.rpm                                                                             | 443 kB  00:00:00
(19/30): devtoolset-11-perftools-11.1-2.el7.x86_64.rpm                                                                             | 3.1 kB  00:00:00
(20/30): devtoolset-11-runtime-11.1-2.el7.x86_64.rpm                                                                               |  20 kB  00:00:00
(21/30): devtoolset-11-oprofile-1.4.0-2.el7.x86_64.rpm                                                                             | 1.8 MB  00:00:00
(22/30): devtoolset-11-systemtap-4.5-7.el7.x86_64.rpm                                                                              |  15 kB  00:00:00
(23/30): devtoolset-11-strace-5.13-3.3.el7.x86_64.rpm                                                                              | 1.3 MB  00:00:00
(24/30): devtoolset-11-systemtap-devel-4.5-7.el7.x86_64.rpm                                                                        | 2.3 MB  00:00:00
(25/30): devtoolset-11-systemtap-client-4.5-7.el7.x86_64.rpm                                                                       | 3.7 MB  00:00:00
(26/30): devtoolset-11-systemtap-runtime-4.5-7.el7.x86_64.rpm                                                                      | 437 kB  00:00:00
(27/30): devtoolset-11-toolchain-11.1-2.el7.x86_64.rpm                                                                             | 3.3 kB  00:00:00
(28/30): elfutils-devel-0.176-5.el7.x86_64.rpm                                                                                     |  90 kB  00:00:00
(29/30): xz-devel-5.2.2-2.el7_9.x86_64.rpm                                                                                         |  46 kB  00:00:00
(30/30): devtoolset-11-valgrind-3.17.0-4.el7.x86_64.rpm                                                                            |  11 MB  00:00:01
----------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                     7.4 MB/s |  99 MB  00:00:13
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : devtoolset-11-runtime-11.1-2.el7.x86_64                                                                                               1/30
  Installing : devtoolset-11-elfutils-libelf-0.185-2.el7.x86_64                                                                                      2/30
  Installing : devtoolset-11-elfutils-libs-0.185-2.el7.x86_64                                                                                        3/30
  Installing : devtoolset-11-elfutils-debuginfod-client-0.185-2.el7.x86_64                                                                           4/30
  Installing : devtoolset-11-elfutils-0.185-2.el7.x86_64                                                                                             5/30
  Installing : devtoolset-11-dyninst-11.0.0-1.el7.x86_64                                                                                             6/30
  Installing : devtoolset-11-binutils-2.36.1-1.el7.2.x86_64                                                                                          7/30
  Installing : devtoolset-11-systemtap-runtime-4.5-7.el7.x86_64                                                                                      8/30
  Installing : devtoolset-11-systemtap-client-4.5-7.el7.x86_64                                                                                       9/30
  Installing : devtoolset-11-strace-5.13-3.3.el7.x86_64                                                                                             10/30
  Installing : devtoolset-11-dwz-0.14-2.el7.x86_64                                                                                                  11/30
  Installing : devtoolset-11-gdb-10.2-6.el7.x86_64                                                                                                  12/30
  Installing : devtoolset-11-libstdc++-devel-11.2.1-9.1.el7.x86_64                                                                                  13/30
  Installing : 1:devtoolset-11-make-4.3-1.el7.x86_64                                                                                                14/30
  Installing : devtoolset-11-annobin-docs-10.38-1.el7.noarch                                                                                        15/30
  Installing : 1:devtoolset-11-valgrind-3.17.0-4.el7.x86_64                                                                                         16/30
  Installing : devtoolset-11-oprofile-1.4.0-2.el7.x86_64                                                                                            17/30
  Installing : devtoolset-11-ltrace-0.7.91-1.el7.x86_64                                                                                             18/30
  Installing : devtoolset-11-memstomp-0.1.5-6.el7.x86_64                                                                                            19/30
  Installing : xz-devel-5.2.2-2.el7_9.x86_64                                                                                                        20/30
  Installing : devtoolset-11-gcc-11.2.1-9.1.el7.x86_64                                                                                              21/30
  Installing : devtoolset-11-gcc-c++-11.2.1-9.1.el7.x86_64                                                                                          22/30
  Installing : devtoolset-11-libquadmath-devel-11.2.1-9.1.el7.x86_64                                                                                23/30
  Installing : devtoolset-11-gcc-gfortran-11.2.1-9.1.el7.x86_64                                                                                     24/30
  Installing : devtoolset-11-toolchain-11.1-2.el7.x86_64                                                                                            25/30
  Installing : elfutils-devel-0.176-5.el7.x86_64                                                                                                    26/30
  Installing : devtoolset-11-systemtap-devel-4.5-7.el7.x86_64                                                                                       27/30
  Installing : devtoolset-11-systemtap-4.5-7.el7.x86_64                                                                                             28/30
  Installing : devtoolset-11-perftools-11.1-2.el7.x86_64                                                                                            29/30
  Installing : devtoolset-11-11.1-2.el7.x86_64                                                                                                      30/30
  Verifying  : devtoolset-11-strace-5.13-3.3.el7.x86_64                                                                                              1/30
  Verifying  : devtoolset-11-dwz-0.14-2.el7.x86_64                                                                                                   2/30
  Verifying  : xz-devel-5.2.2-2.el7_9.x86_64                                                                                                         3/30
  Verifying  : devtoolset-11-systemtap-4.5-7.el7.x86_64                                                                                              4/30
  Verifying  : elfutils-devel-0.176-5.el7.x86_64                                                                                                     5/30
  Verifying  : devtoolset-11-elfutils-debuginfod-client-0.185-2.el7.x86_64                                                                           6/30
  Verifying  : devtoolset-11-11.1-2.el7.x86_64                                                                                                       7/30
  Verifying  : devtoolset-11-gdb-10.2-6.el7.x86_64                                                                                                   8/30
  Verifying  : devtoolset-11-libstdc++-devel-11.2.1-9.1.el7.x86_64                                                                                   9/30
  Verifying  : devtoolset-11-gcc-gfortran-11.2.1-9.1.el7.x86_64                                                                                     10/30
  Verifying  : devtoolset-11-perftools-11.1-2.el7.x86_64                                                                                            11/30
  Verifying  : 1:devtoolset-11-make-4.3-1.el7.x86_64                                                                                                12/30
  Verifying  : devtoolset-11-elfutils-0.185-2.el7.x86_64                                                                                            13/30
  Verifying  : devtoolset-11-gcc-c++-11.2.1-9.1.el7.x86_64                                                                                          14/30
  Verifying  : devtoolset-11-systemtap-client-4.5-7.el7.x86_64                                                                                      15/30
  Verifying  : devtoolset-11-systemtap-runtime-4.5-7.el7.x86_64                                                                                     16/30
  Verifying  : devtoolset-11-elfutils-libelf-0.185-2.el7.x86_64                                                                                     17/30
  Verifying  : devtoolset-11-toolchain-11.1-2.el7.x86_64                                                                                            18/30
  Verifying  : devtoolset-11-libquadmath-devel-11.2.1-9.1.el7.x86_64                                                                                19/30
  Verifying  : devtoolset-11-annobin-docs-10.38-1.el7.noarch                                                                                        20/30
  Verifying  : devtoolset-11-gcc-11.2.1-9.1.el7.x86_64                                                                                              21/30
  Verifying  : devtoolset-11-runtime-11.1-2.el7.x86_64                                                                                              22/30
  Verifying  : 1:devtoolset-11-valgrind-3.17.0-4.el7.x86_64                                                                                         23/30
  Verifying  : devtoolset-11-oprofile-1.4.0-2.el7.x86_64                                                                                            24/30
  Verifying  : devtoolset-11-ltrace-0.7.91-1.el7.x86_64                                                                                             25/30
  Verifying  : devtoolset-11-systemtap-devel-4.5-7.el7.x86_64                                                                                       26/30
  Verifying  : devtoolset-11-elfutils-libs-0.185-2.el7.x86_64                                                                                       27/30
  Verifying  : devtoolset-11-binutils-2.36.1-1.el7.2.x86_64                                                                                         28/30
  Verifying  : devtoolset-11-dyninst-11.0.0-1.el7.x86_64                                                                                            29/30
  Verifying  : devtoolset-11-memstomp-0.1.5-6.el7.x86_64                                                                                            30/30

Installed:
  devtoolset-11.x86_64 0:11.1-2.el7

Dependency Installed:
  devtoolset-11-annobin-docs.noarch 0:10.38-1.el7                          devtoolset-11-binutils.x86_64 0:2.36.1-1.el7.2
  devtoolset-11-dwz.x86_64 0:0.14-2.el7                                    devtoolset-11-dyninst.x86_64 0:11.0.0-1.el7
  devtoolset-11-elfutils.x86_64 0:0.185-2.el7                              devtoolset-11-elfutils-debuginfod-client.x86_64 0:0.185-2.el7
  devtoolset-11-elfutils-libelf.x86_64 0:0.185-2.el7                       devtoolset-11-elfutils-libs.x86_64 0:0.185-2.el7
  devtoolset-11-gcc.x86_64 0:11.2.1-9.1.el7                                devtoolset-11-gcc-c++.x86_64 0:11.2.1-9.1.el7
  devtoolset-11-gcc-gfortran.x86_64 0:11.2.1-9.1.el7                       devtoolset-11-gdb.x86_64 0:10.2-6.el7
  devtoolset-11-libquadmath-devel.x86_64 0:11.2.1-9.1.el7                  devtoolset-11-libstdc++-devel.x86_64 0:11.2.1-9.1.el7
  devtoolset-11-ltrace.x86_64 0:0.7.91-1.el7                               devtoolset-11-make.x86_64 1:4.3-1.el7
  devtoolset-11-memstomp.x86_64 0:0.1.5-6.el7                              devtoolset-11-oprofile.x86_64 0:1.4.0-2.el7
  devtoolset-11-perftools.x86_64 0:11.1-2.el7                              devtoolset-11-runtime.x86_64 0:11.1-2.el7
  devtoolset-11-strace.x86_64 0:5.13-3.3.el7                               devtoolset-11-systemtap.x86_64 0:4.5-7.el7
  devtoolset-11-systemtap-client.x86_64 0:4.5-7.el7                        devtoolset-11-systemtap-devel.x86_64 0:4.5-7.el7
  devtoolset-11-systemtap-runtime.x86_64 0:4.5-7.el7                       devtoolset-11-toolchain.x86_64 0:11.1-2.el7
  devtoolset-11-valgrind.x86_64 1:3.17.0-4.el7                             elfutils-devel.x86_64 0:0.176-5.el7
  xz-devel.x86_64 0:5.2.2-2.el7_9

Complete!
[xxx]# scl enable devtoolset-11 bash
(base) [xxx]# gcc --version
gcc (GCC) 11.2.1 20220127 (Red Hat 11.2.1-9)
Copyright (C) 2021 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.

Guess you like

Origin blog.csdn.net/holyvslin/article/details/132358311