Home > System Tutorial > LINUX > body text

Detailed explanation of the steps to upgrade gcc using yum on CentOS6.5

WBOY
Release: 2023-12-31 10:59:41
forward
1407 people have browsed it

Because we need to use C 11, but the gcc4.4.7 that comes with CentOS does not support it, we decided to upgrade gcc.

The operation is as follows:

#Backup

mv /etc/yum.repos.d/devtools-2.repo /etc/yum.repos.d/devtools-2.repo.bak wget http://people.centos.org/tru/devtools-2 /devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo

yum install devtoolset-2-gcc devtoolset-2-binutils

yum install devtoolset-2-gcc-c

These three files will be downloaded to: /opt/rh/devtoolset-2/root/, and then set the soft link:

#Back up the original 4.4.7 version

mv /usr/bin/gcc /usr/bin/gcc-4.4.7

mv /usr/bin/g /usr/bin/g -4.4.7

mv /usr/bin/c /usr/bin/c -4.4.7

#Set soft link

ln -s /opt/rh/devtoolset-2/root/usr/bin/gcc /usr/bin/gcc

ln -s /opt/rh/devtoolset-2/root/usr/bin/c /usr/bin/c

ln -s /opt/rh/devtoolset-2/root/usr/bin/g /usr/bin/g

gcc -v

The above is the detailed content of Detailed explanation of the steps to upgrade gcc using yum on CentOS6.5. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template