How to upgrade gcc on CentOS6.5
2017-12-20 18:11
417 查看
How to upgrade gcc on CentOS6.5
Question: The default gcc version on CentOS6.5 is too old to build a particular application. How can I upgrade the version of gcc installed on CentOS6.5?As of CentOS 6.5, the default version of gcc installed is 4.4.7. If you want to upgrade gcc on CentOS, you can install devtools, which is a CentOS version of Red Hat Developer Toolset. The devtools, which is available for CentOS 5 and 6, contains a suite of development tools including gcc, gdb, binutils, elfutils, etc. The devtools 1.1. offers gcc version 4.7.2.
To install devtools on CentOS, use the following commands.
$ sudo wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo -P /etc/yum.repos.d $ sudo sh -c 'echo "enabled=1" >> /etc/yum.repos.d/devtools-1.1.repo' $ sudo yum install devtoolset-1.1
devtools will be installed under /opt/centos/devtoolset-1.1.
To use gcc from devtoolset, use the following command. This command will launch a new shell, wherein all environment variables are automatically set to use devtools.
$ scl enable devtoolset-1.1 bash $ gcc --version
Alternatively, you can explicitly define the following variables to use devtools.
export CC=/opt/centos/devtoolset-1.1/root/usr/bin/gcc export CPP=/opt/centos/devtoolset-1.1/root/usr/bin/cpp export CXX=/opt/centos/devtoolset-1.1/root/usr/bin/c++
参考:
http://ask.xmodulo.com/upgrade-gcc-centos.html
相关文章推荐
- 发现问题 解决问题:How to upgrade gcc on CentOS
- How to Add a User and Grant Root Privileges on CentOS 6.5
- How to Install Python 2.7 on CentOS6.5
- How to install php memcached on CentOS 6.5
- How to Upgrade Linux Kernel to Stable 3.18.4 on CentOS 7.x
- How to upgrade Ghost on OpenShift #2
- How to Install and Configure Nginx from Source on centos--转
- How to setup Ruby and RubyGems on CentOS?
- how-to-install-elasticsearch-on-centos6.6-x86_64
- How to Install php-mcrypt on CentOS 6.2
- How To Install Git on CentOS 7
- How to install MySQL Server 5.6 on CentOS 7 / RHEL 7
- How to Setup NFS (Network File System) on RHEL/CentOS/Fedora and Debian/Ubuntu
- how-to-install-grafana-on-centos6.6-x86_64
- How to Install MySQL on CentOS 7
- how-to-install-ganglia-from-prebuild-rpm-on-centos6.6-x86_64
- How to mount & unmount a USB thumb drive on CentOS 6.x Server
- Howto install VMware tools on Centos 6.3 or Redhat 6.3 RHEL
- How to Setup DNS ( Bind ) Server on CentOS, RHEL 6
- How To Install Python 2.7 with mod_wsgi on CentOS 5.6 with cPanel