1、
sudo yum install centos-release-scl
sudo yum search devtoolset | grep gcc
sudo yum install devtoolset-11-gcc*
sudo source /opt/rh/devtoolset-11/enable
source /opt/rh/devtoolset-11/enable
2、
git clone git://gcc.gnu.org/git/gcc.git cd gcc ./contrib/download_prerequisites mkdir -p build cd build ../configure --prefix=/usr/local/gcc --enable-checking=release --enable-languages=c,c++ --disable-multilib make sudo make install export PATH=/usr/local/gcc/bin/:$PATH export LD_LIBRARY_PATH=/usr/local/gcc/lib64:$LD_LIBRARY_PATH $ gcc --version gcc (GCC) 13.0.0 20221029 (experimental) $ c++ --version c++ (GCC) 13.0.0 20221029 (experimental)标签:gcc,git,centos,devtoolset,--,升级,PATH From: https://www.cnblogs.com/lh03061238/p/16850335.html