參考
阿裡巴巴開源鏡像站-OPSX鏡像站簡介
EPEL (Extra Packages for Enterprise Linux), 是由 Fedora Special Interest Group 維護的 Enterprise Linux(RHEL、CentOS)中經常用到的包。
在配置之前先備份好原檔案執行
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
![](https://img.laitimes.com/img/__Qf2AjLwojIjJCLyojI0JCLiYWan5SNiZGNlJDM0ImZ1MWM2EGOkJzM0IjZlFDOyATNjNGOl9CX5d2bs92Yl1iclB3bsVmdlR2LcNWaw9CXt92Yu4GZjlGbh5yYjV3Lc9CX6MHc0RHaiojIsJye.gif)
下載下傳新repo 到/etc/yum.repos.d/
安裝 epel 配置包
yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
将 repo 配置中的位址替換為阿裡雲鏡像站位址
sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
執行yum install epel-release -y 安裝更新
yum install epel-release -y
完成