CentOS7 中把yum源更换成163源

1,首先我们把CentOS7配置为可以上外网的环境
2,进入yum源配置文件 cd /etc/yum.repos.d
3,备份一下当前的源,以防出错后可以还原回来mv ./CentOS-Base.repo ./CentOS-Base-repo.bak
4,下载网易163的源 wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
5,清理一下旧包 yum clean all
6,把下载下来文件 CentOS7-Base-163.repo设置成为默认源 mv CentOS7-Base-163.repo CentOS-Base.repo
7,生成缓存即可用163源了 yum makecache
8.更新yum源 yum update

posted @ 2019-01-20 12:59  飘散的白乌云  阅读(914)  评论(0编辑  收藏  举报