常用源列表

网易:https://mirrors.163.com/
搜狐:http://mirrors.sohu.com/
阿里云:https://developer.aliyun.com/mirror/
中国科技大学:https://mirrors.ustc.edu.cn/
清华大学:https://mirrors.tuna.tsinghua.edu.cn/
北京交通大学:https://mirror.bjtu.edu.cn/
华为:https://mirrors.huaweicloud.com/

安装

—-阿里云镜像源

备份

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

下载新的CentOS-Base.repo 到/etc/yum.repos.d/

# CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

epel

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

之后运行 yum clean all,yum makecache 生成缓存