CentOS默认yum源是国外的,今天我们把默认源换成国内的163源,163是目前国内最好用的源,速度是相当快的,还有一些比较好的源,比如阿里源。
#进入yum源配置文件
cd /etc/yum.repos.d
#备份一下当前的源,以防出错后可以还原回来
mv ./CentOS-Base.repo ./CentOS-Base-repo.bak
#下载网易163的源
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
#清理一下旧包
yum clean all
#把下载下来文件 CentOS7-Base-163.repo设置成为默认源
mv Centos-7.repo CentOS-Base.repo
#生成缓存即可用163源了
yum makecache
网友评论