脚本内容如下:
#!/bin/sh sudo rpm --import http://ftp.scientificlinux.org/linux/scientific/5x/x86_64/RPM-GPG-KEYs/RPM-GPG-KEY-cern wget -O /etc/yum.repos.d/slc6-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo sudo yum install devtoolset-2 -y scl enable devtoolset-2 bash echo "source /opt/rh/devtoolset-2/enable" >> ~/.bashrc原文链接:https://www.f2er.com/centos/382126.html