國內的開源鏡像站有很多,下面分別以阿里、網易、清華為例,更換CentOS系統的yum源。
一、進入阿里鏡像站:https://developer.aliyun.com/mirror

點擊“centos”,根據官網文檔,選擇對應系統版本的yum源
1、備份原來的yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下載CentOS 7的yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
3、下載epel擴展源
點擊“epel”,根據官網文檔,選擇對應系統版本的yum源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
4、清理緩存,生成新緩存
yum clean all
yum makecache
二、進入網易鏡像站:http://mirrors.163.com
點擊使用幫助列的“centos使用幫助”

根據官網文檔的“使用說明”操作即可。

三、清華鏡像站:https://mirrors.tuna.tsinghua.edu.cn
點擊右側的“使用幫助”

在左側選擇“centos”,根據CentOS鏡像使用幫助操作即可。

