Many software packages now require GLIBCXX >=3.4.20 to be compiled by default. When this happens, the Redhat department cries again. At present, the gcc in the default warehouse of Centos7.x is still 4.8.5, so we need a way to upgrade gcc related components>= 4.9.1.
There are two ways to upgrade the gcc version under CentOS, one is to add other sources for automatic upgrade, the other is to manually compile and upgrade, here are two ways to automatically upgrade:
Add the file FedoraRepo.repo in the /etc/yum.repos.d directory and enter the following:
[ warning:fedora]
name=fedora
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-23&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=https://getfedora.org/static/34EC9CBA.txt
Then execute
yum update gcc gcc-c++
yum install centos-release-scl
yum install devtoolset-4-gcc*
scl enable devtoolset-4 bash
which gcc
gcc --version
Recommended Posts