1. 程式人生 > 其它 >Linux系統yum源優化

Linux系統yum源優化

推薦的yum源:

1、阿里yum源:https://developer.aliyun.com/mirror/centos
2、清華yum源:https://mirrors.tuna.tsinghua.edu.cn/help/centos/
3、網易yum源:http://mirrors.163.com/.help/centos.html

以阿里yum源為例進行設定(系統Centos7)

配置基礎的yum源

第一步:備份原有的 CentOS-Base.repo 檔案

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

第二步:下載阿里提供的 CentOS-Base.repo 檔案到 /etc/yum.repos.d/ 目錄下

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

配置擴充套件的yum源

https://developer.aliyun.com/mirror/epel
第一步:備份(如果配置過其他epel源)

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

第二步:下載阿里提供的epel yun原始檔到 /etc/yum.repos.d/ 目錄下

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo