linux yum升级gcc版本
在上一篇文章linux快速升级gcc版本中,gcc被yum升级到了4.8.2,今天重新在新的机器上升级gcc的时候,居然出现下面的问题:
# yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++ -y
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirror.as24220.net
* extras: mirror.as24220.net
* updates: mirror.as24220.net
http://people.centos.org/tru/devtools-2/6/x86_64/RPMS/repodata/repomd.xml: [Errno 14] Peer cert cannot be verified or peer cert invalid
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: testing-devtools-2-centos-6. Please verify its path and try again
估计是yum源地址出现问题了,下面来看怎么解决.
解决方法:
wget -O /etc/yum.repos.d/slc6-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo
yum --nogpgcheck install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++ -y
ln -s /opt/rh/devtoolset-2/root/usr/bin/* /usr/local/bin/
hash -r
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.
好了,gcc又升级成功了,如果还有问题就只能请大家自己去解决.
评论: