摘要:我們在需要升級(jí)的版本。但是為了軟件的穩(wěn)定和版本支持,上版本也是,所以無法使用進(jìn)行軟件更新,需要安裝源升級(jí)。更換國內(nèi)鏡像源執(zhí)行替換命令將軟件倉庫地址替換為國內(nèi)鏡像地址。
Centos7 gcc 版本默認(rèn) 4.8.5,而有些軟件(例如:Redis6、Mariadb10 等)的編譯安裝需要最低支持 c++11 的 gcc 5.x 版本。我們在需要升級(jí) gcc 的版本。但是 Red Hat 為了軟件的穩(wěn)定和版本支持,yum 上版本也是 4.8.5,所以無法使用 yum 進(jìn)行軟件更新,需要安裝 SCL 源升級(jí) gcc。
$ gcc -v
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
SCL 軟件集(Software Collections),是為了給 RHEL/CentOS 用戶提供一種以方便、安全地安裝和使用應(yīng)用程序和運(yùn)行時(shí)環(huán)境的多個(gè)(而且可能是更新的)版本的方式,同時(shí)避免把系統(tǒng)搞亂。
yum install -y centos-release-scl scl-utils-build
執(zhí)行替換命令將軟件倉庫地址替換為國內(nèi)鏡像地址。
# 清華大學(xué)
sed -i s+#baseurl=http://mirror.centos.org+baseurl=https://mirrors.tuna.tsinghua.edu.cn+ /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
sed -i s+mirrorlist=+#mirrorlist=+ /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
sed -i s+# baseurl=http://mirror.centos.org+baseurl=https://mirrors.tuna.tsinghua.edu.cn+ /etc/yum.repos.d/CentOS-SCLo-scl.repo
sed -i s+mirrorlist=+#mirrorlist=+ /etc/yum.repos.d/CentOS-SCLo-scl.repo
# 阿里云
sed -i s+#baseurl=http://mirror.centos.org+baseurl=https://mirrors.aliyun.com+ /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
sed -i s+mirrorlist=+#mirrorlist=+ /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
sed -i s+# baseurl=http://mirror.centos.org+baseurl=https://mirrors.aliyun.com+ /etc/yum.repos.d/CentOS-SCLo-scl.repo
sed -i s+mirrorlist=+#mirrorlist=+ /etc/yum.repos.d/CentOS-SCLo-scl.repo
# 騰訊云
sed -i s+#baseurl=http://mirror.centos.org+baseurl=https://mirrors.cloud.tencent.com+ /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
sed -i s+mirrorlist=+#mirrorlist=+ /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
sed -i s+# baseurl=http://mirror.centos.org+baseurl=https://mirrors.cloud.tencent.com+ /etc/yum.repos.d/CentOS-SCLo-scl.repo
sed -i s+mirrorlist=+#mirrorlist=+ /etc/yum.repos.d/CentOS-SCLo-scl.repo
# 騰訊云內(nèi)網(wǎng)
sed -i s+#baseurl=http://mirror.centos.org+baseurl=https:///mirrors.tencentyun.com+ /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
sed -i s+mirrorlist=+#mirrorlist=+ /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
sed -i s+# baseurl=http://mirror.centos.org+baseurl=https:///mirrors.tencentyun.com+ /etc/yum.repos.d/CentOS-SCLo-scl.repo
sed -i s+mirrorlist=+#mirrorlist=+ /etc/yum.repos.d/CentOS-SCLo-scl.repo
# 阿里云內(nèi)網(wǎng)
sed -i s+#baseurl=http://mirror.centos.org+baseurl=https://mirrors.cloud.aliyuncs.com+ /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
sed -i s+mirrorlist=+#mirrorlist=+ /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
sed -i s+# baseurl=http://mirror.centos.org+baseurl=https://mirrors.cloud.aliyuncs.com+ /etc/yum.repos.d/CentOS-SCLo-scl.repo
sed -i s+mirrorlist=+#mirrorlist=+ /etc/yum.repos.d/CentOS-SCLo-scl.repo
替換后的文件內(nèi)容如下。
# CentOS-SCLo-sclo.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more
# information
[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/7/sclo/$basearch/sclo/
#mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-sclo
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
[centos-sclo-sclo-testing]
name=CentOS-7 - SCLo sclo Testing
baseurl=http://buildlogs.centos.org/centos/7/sclo/$basearch/sclo/
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
[centos-sclo-sclo-source]
name=CentOS-7 - SCLo sclo Sources
baseurl=http://vault.centos.org/centos/7/sclo/Source/sclo/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
[centos-sclo-sclo-debuginfo]
name=CentOS-7 - SCLo sclo Debuginfo
baseurl=http://debuginfo.centos.org/centos/7/sclo/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
# CentOS-SCLo-sclo.repo
#
# Please see http://wiki.centos.org/SpecialInterestGroup/SCLo for more
# information
[centos-sclo-sclo]
name=CentOS-7 - SCLo sclo
# baseurl=http://mirror.centos.org/centos/7/sclo/$basearch/sclo/
mirrorlist=http://mirrorlist.centos.org?arch=$basearch&release=7&repo=sclo-sclo
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
[centos-sclo-sclo-testing]
name=CentOS-7 - SCLo sclo Testing
baseurl=http://buildlogs.centos.org/centos/7/sclo/$basearch/sclo/
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
[centos-sclo-sclo-source]
name=CentOS-7 - SCLo sclo Sources
baseurl=http://vault.centos.org/centos/7/sclo/Source/sclo/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
[centos-sclo-sclo-debuginfo]
name=CentOS-7 - SCLo sclo Debuginfo
baseurl=http://debuginfo.centos.org/centos/7/sclo/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
yum makecache fast
devtoolset (Developer Toolset)是按照 Software Collections 的規(guī)范打出來的一套 rpm 包,提供了最新版本的 GNU 編譯器集合,GNU 調(diào)試器以及其他開發(fā),調(diào)試和性能監(jiān)視工具。
# yum list all --enablerepo=centos-sclo-rh | grep devtoolset-9-gcc
Repository epel is listed more than once in the configuration
devtoolset-9-gcc.x86_64 9.3.1-2.el7 centos-sclo-rh
devtoolset-9-gcc-c++.x86_64 9.3.1-2.el7 centos-sclo-rh
devtoolset-9-gcc-gdb-plugin.x86_64 9.3.1-2.el7 centos-sclo-rh
devtoolset-9-gcc-gfortran.x86_64 9.3.1-2.el7 centos-sclo-rh
devtoolset-9-gcc-plugin-devel.x86_64 9.3.1-2.el7 centos-sclo-rh
yum install -y devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
// 臨時(shí)有效,退出 shell 或重啟會(huì)恢復(fù)原 gcc 版本
scl enable devtoolset-9 bash
// 長期有效
echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile
此時(shí)再查看 gcc 版本。
$ gcc -v
gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)
$ scl -l
devtoolset-9
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/125969.html
摘要:如果我們是新服務(wù)器重新配置,那就可以只安裝一個(gè)新版本。第一服務(wù)器升級(jí)圖片描述這里會(huì)自動(dòng)安裝且檢測最新版本。如果我們以后需要執(zhí)行版本的話,可以這樣腳本。這樣,我們是不是很簡單的就可以將當(dāng)前系統(tǒng)已有的版本保留且安裝到默認(rèn)版本。 目前服務(wù)器的系統(tǒng)是CENTOS6.5版本鏡像,已有軟件是在Python2.7.5默認(rèn)環(huán)境中運(yùn)行,但是由于有一個(gè)新的工具腳本需要在Python3.x版本中運(yùn)行,這里需...
配置要求: 系統(tǒng):centos6.5 目標(biāo):基于CUDA8.0+Opencv3.1+Cudnnv5.1+python3.6接口的caffe框架 gcc是linux編譯安裝必備的編譯器 CentOS6.5自帶的gcc版本是4.4.7,并不支持C++11查詢后可得需要版本高于4.8.1的gcc才能支持C++11輸入 yum info gcc 發(fā)現(xiàn)可升級(jí)的gcc版本低于4.8.1,只能手動(dòng)編譯安裝4....
摘要:安裝安裝驗(yàn)證其它依賴包安裝警告頭密鑰準(zhǔn)備中正在升級(jí)安裝警告頭密鑰準(zhǔn)備中正在升級(jí)安裝安裝安裝好上述依賴包后就可以安裝了。安裝如下使用將解壓到目錄,編譯安裝配置安裝好后我們需要對進(jìn)行配置。 場景 項(xiàng)目中有三臺(tái)應(yīng)用服務(wù)器,系統(tǒng)為Centos 7 ,應(yīng)用地址分別為: 192.168.198.229:8080 192.168.198.230:8080 192.168.198.231:8080 ...
閱讀 3580·2023-04-25 20:09
閱讀 3770·2022-06-28 19:00
閱讀 3115·2022-06-28 19:00
閱讀 3129·2022-06-28 19:00
閱讀 3230·2022-06-28 19:00
閱讀 2917·2022-06-28 19:00
閱讀 3104·2022-06-28 19:00
閱讀 2704·2022-06-28 19:00