Initial version:
< p>The following is the process of CentOS6.6 to upgrade gcc to 4.8.2:
Installation warehouse:
< p>
1 #Install warehouse
2 wget http://people.centos.org/tru/devtools-2/devtools-2.repo
3 mv devtools-2.repo /etc/yum.repos.d
4
5 #Upgrade gcc, etc.
6 yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc -c++
Configuration:
1 #Save the previous gcc (you can also delete it directly)
2 mv /usr/bin/gcc /usr/bin/gcc-4.4 .7
3 mv /usr/bin/g++ /usr/bin/g++ -4.4.7
4 mv /usr/bin/c++ /usr/bin/c++ -4.4.7
5
6 #Create a soft link for the new version of gcc
7 ln -s /opt/rh/devtoolset -2/root/usr/bin/gcc /usr/bin/gcc
8 ln -s /opt/rh/devtoolset-2/root/usr/bin/c++ /usr/bin/c++
9 ln -s /opt/rh/devtoolset-2/root/usr/bin/g++ /usr/bin/g++
Confirm whether the version is successfully upgraded:
< p>
1 #Install warehouse
2 wget http://people.centos.org/tru/devtools-2/devtools-2.repo
3 mv devtools-2.repo /etc/yum.repos.d
4
5 #Upgrade gcc, etc.
6 yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc -c++
1 # Save the previous gcc (you can also delete it directly)
2 mv /usr/bin/gcc /usr/bin/gcc-4.4 .7
3 mv /usr/bin/g++ /usr/bin/g++ -4.4.7
4 mv /usr/bin/c++ /usr/bin/c++ -4.4.7
5
6 #Create a soft link for the new version of gcc
7 ln -s /opt/rh/devtoolset -2/root/usr/bin/gcc /usr/bin/gcc
8 ln -s /opt/rh/devtoolset-2/root/usr/bin/c++ /usr/bin/c++
9 ln -s /opt/rh/devtoolset-2/root/usr/bin/g++ /usr/bin/g++