Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install or upgrade g++ in CentOS 6? [closed]

Tags:

linux

g++

centos

I have CentOS 6, and have installed g++ 4.4.7 with yum install devtoolset-2

However, I want to install g++ 4.8 or higher. How can I do this?

like image 706
nima Avatar asked Sep 07 '15 05:09

nima


1 Answers

You can download the rpm from here, but note that the package is for CentOS 7. http://mirror.centos.org/centos/7/os/x86_64/Packages/gcc-4.8.3-9.el7.x86_64.rpm

Did you check here https://superuser.com/questions/381160/how-to-install-gcc-4-7-x-4-8-x-on-centos?

That what worked for me:

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

/opt/rh/devtoolset-2/root/usr/bin/gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15
like image 128
Stas Avatar answered Oct 09 '22 06:10

Stas