Centos7换国内源
- 备份之前的默认源,权限不够地话获取root权限即可
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
- 换阿里源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
- 运行yum makecache生成缓存
yum clean all # 清除系统所有的yum缓存
yum makecache
- 查看所有的源
yum repolist all
- 查看可用的源
yum repolist enabled