日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CentOS 使用 IUS _ SCL 第三方软件源

發布時間:2025/6/17 编程问答 28 如意码农
生活随笔 收集整理的這篇文章主要介紹了 CentOS 使用 IUS _ SCL 第三方软件源 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

CentOS 使用 IUS / SCL 第三方軟件源

使用centos 經常發現官方提供的軟件包版本過低,很多時候大家會選擇下載源碼自行編譯,帶來了很多麻煩。

centos安裝最新版本軟件包,例如git,python等,可以通過紅帽官方提供的software collection,或者社區提供的ius實現。

IUS

IUS是一個社區維護的軟件源,全名是Inline with Upstream Stable,官網為https://ius.io/,通過github組織社區https://github.com/iuscommunity

IUS被git幫助文檔推薦作為centos等系統安裝新版本git的第三方源:https://git-scm.com/download/linux

安裝IUS是直接安裝軟件包,并不像SCL還帶了虛擬環境的概念。所以使用起來相對簡單。

安裝git命令:

yum install epel-release
rpm -U https://centos7.iuscommunity.org/ius-release.rpm
yum remove git
yum install git2u

IUS為了避免與官方源沖突,所以對軟件包名進行了修改, 規則為:{name}{major_version}{minor_version}u 。

IUS支持的軟件包,可通過github查詢

IUS直接訪問速度不是很理想,可以設置國內鏡像:

IUS 站點根目錄為:https://dl.iuscommunity.org/pub/ius/

對應的阿里云鏡像為:https://mirrors.aliyun.com/ius/

鏡像列表:https://mirrors.iuscommunity.org/mirrors

清華大學鏡像:https://mirrors.tuna.tsinghua.edu.cn/ius/

同濟大學鏡像:https://mirrors.tongji.edu.cn/ius/

編輯 /etc/yum.repos.d/ius.repo,將官方網址修改為鏡像地址

命令替換:

sed -i "s|repo.ius.io|mirrors.tuna.tsinghua.edu.cn/ius|g" /etc/yum.repos.d/ius.repo

repo文件:

[ius]
name = IUS for Enterprise Linux 7 - $basearch
baseurl = https://mirrors.tuna.tsinghua.edu.cn/ius/7/$basearch/
enabled = 1
repo_gpgcheck = 0
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-IUS-7 [ius-debuginfo]
name = IUS for Enterprise Linux 7 - $basearch - Debug
baseurl = https://mirrors.tuna.tsinghua.edu.cn/ius/7/$basearch/debug/
enabled = 0
repo_gpgcheck = 0
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-IUS-7 [ius-source]
name = IUS for Enterprise Linux 7 - Source
baseurl = https://mirrors.tuna.tsinghua.edu.cn/ius/7/src/
enabled = 0
repo_gpgcheck = 0
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-IUS-7

update:

通過鏡像安裝

wget https://mirrors.aliyun.com/ius/ius-release-el7.rpm
rpm -i ius-release-el7.rpm

參考:

https://www.cnblogs.com/f-ck-need-u/p/8494992.html

update 2022-11-22:

包名去除了最后的字母,安裝git: yum install git236

SCL

scl不是一個簡單的包管理工具,而是類似python的venv(virtualenv) 。它可以支持系統同時安裝多個版本的軟件,然后通過scl enable命令來激活相應軟件環境,而不會對原始的軟件環境產生影響。

以git安裝和啟用為例:

yum install centos-release-scl
yum install rh-git29
scl enable rh-git29 bash ##激活git的打開bash
git --version

但是對于我們而言,如果不需要這么復雜的虛擬環境功能,單純想要使用其提供的最新版本軟件,可以通過 source scl_source enable 命令實現。

如果需要系統重啟后,能夠自動啟動最新版本軟件環境,可進行以下配置:

#通過bash環境來設定,僅對特定用戶啟用
vi ~/.bashrc # or ~/.bash_profile source scl_source enable rh-git29

或者

#對全局用戶啟用
vi /etc/profile.d/enable_scl.sh #!/bin/bash
source scl_source enable rh-git29

或者

scl enable rh-git29 bash
which git
/opt/rh/rh-git29/root/usr/bin/git ln -s /opt/rh/rh-git29/root/usr/bin/git /usr/bin/git

其他軟件源:

https://www.cnblogs.com/mawanglin2008/p/3532247.html

參考:

https://www.softwarecollections.org/en/docs/

http://xmodulo.com/enable-software-collections-centos.html

https://unix.stackexchange.com/questions/175851/how-to-permanently-enable-scl-centos-6-4

https://serverfault.com/questions/751155/permanently-enable-a-scl

https://access.redhat.com/solutions/527703

總結

以上是生活随笔為你收集整理的CentOS 使用 IUS _ SCL 第三方软件源的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。