How to install gcc using chroot - zedware/notebook GitHub Wiki
The default version of g++ for CentOS 6 is 4.4.x. And the default one for CentOS 7 is 4.8.x. See link for details.
$ cat chroot.repo [centos.7.base.$basearch] name=centos7 baseurl=http://mirrors.yun-idc.com/centos/7/os/$basearch gpgcheck=0 $ sudo yum install -c chroot.repo --installroot=/home/zedware/chroot gcc gcc-c++ gdb make $ sudo chroot /home/zedware/chroot
NB:
- Have to chroot to use the new tools
- Have to cp/mv the source code to be compiled with the new tool