Instantly share code, notes, and snippets.

@giwa /file0.txt
Last active Dec 8, 2018

Embed
What would you like to do?
Install g++/gcc 4.8.2 in CentOS 6.6 ref: http://qiita.com/giwa/items/28c754d8fc2936c0f6d2
$ 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++ devtoolset-2-gcc-gfortran
$ /opt/rh/devtoolset-2/root/usr/bin/gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
scl enable devtoolset-2 bash
source /opt/rh/devtoolset-2/enable
@srikanthjeeva

This comment has been minimized.

srikanthjeeva commented Mar 11, 2016

This worked! Thanks!

@leoxk

This comment has been minimized.

leoxk commented Nov 21, 2016

works, thank you.

@wyabhinav

This comment has been minimized.

wyabhinav commented Apr 13, 2017

Works like a charm. Thanks :D

@Lemon-Liu

This comment has been minimized.

Lemon-Liu commented Jul 23, 2017

when typed the code
yum install devtoolset-2-gcc devtoolset-2-binutils
and
yum install devtoolset-2-gcc-c++ devtoolset-2-gcc-gfortran.
the following error came out:

http://people.centos.org/tru/devtools-2/6Server/x86_64/RPMS/repodata/repomd.xml:` [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: testing-devtools-2-centos-6Server. Please verify its path and try again

How can I fix this problem?

@Lemon-Liu

This comment has been minimized.

Lemon-Liu commented Jul 23, 2017

oh~
I fix the problem by edit the file /etc/yum.repos.d/devtools-2.repo:
change the
http://people.centos.org/tru/devtools-2/$releasever/$basearch/RPMS
to
http://people.centos.org/tru/devtools-2/6/x86_64/RPMS
and then follow the code above, it works.
thanks a lot!
and for reference for those like me.

@vip3r011

This comment has been minimized.

vip3r011 commented Sep 25, 2018

to make native gcc use exports:
export CC=/opt/rh/devtoolset-2/root/usr/bin/gcc
export CPP=/opt/rh/devtoolset-2/root/usr/bin/cpp
export CXX=/opt/rh/devtoolset-2/root/usr/bin/c++

i used this way to compile swoole-4.2.1 on centos 6.9 php 7.1

@ashimloves

This comment has been minimized.

ashimloves commented Dec 8, 2018

Saved my life after googling here and there for like 3 hours.... phew.. Thanks mate.
In my case I was not able to install couchbase on CentOS 6.8 with g++ 4.7.
Below was the error (hopefully Google indexes it and people can find solution to this error easily).
/root/.node-gyp/8.14.0/include/node/v8-platform.h:133:11: error: overriding ‘virtual v8::Platform::~Platform() noexcept (true)’ make: *** [Release/obj.target/couchbase_impl/src/couchbase_impl.o] Error 1 make: Leaving directory /opt/executron/node_modules/couchbase/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 2.6.32-573.8.1.el6.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/executron/node_modules/couchbase
gyp ERR! node -v v8.14.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! couchbase@2.6.2 install: prebuild-install || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the couchbase@2.6.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-12-08T15_04_39_398Z-debug.log
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment