gcc 離線升級 centos-release-scl方式


1. 在線下載安裝包

yum -y --downloadonly --downloaddir=./gccupdate install centos-release-scl
cd gccupdate
rpm -ivh ./*
yum -y --downloadonly --downloaddir=./gcc7 install devtoolset-7		# 下載gcc 7
#yum -y --downloadonly --downloaddir=./gcc9 install devtoolset-9	# 也可下載gcc 9
cd gcc7
rpm -Uvh ./*
#cd gcc9
#rpm -Uvh ./*
# scl -l
devtoolset-7
devtoolset-9
# scl enable devtoolset-9 bash
# gcc --version
gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)
Copyright (C) 2019 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.
# ls /opt/rh
devtoolset-7  devtoolset-9
# scl enable devtoolset-7 bash # 臨時使用版本7
# echo "source /opt/rh/devtoolset-7/enable" >>/etc/profile # 開機使用版本7

2. 打包軟件包,上傳其他服務器,完成升級

tar -czvf gccupdate.tar.gz gccupdate


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM