第一步、备份系统源镜像文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
PS:备份原来的yum源,备份后以后万一错误还可以恢复。
第二步、下载阿里云Centos 7 yum源镜像文件
先安装wget:
yum install wget -y
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
第三步、清理缓存重新生成缓存
yum clean all
yum makecache
第四步、更新最新源设置
yum update -y
PS:这个我们更新最新的centos7源。我这里没有报错,如果有报错我们再去想办法解决。
总结,这样我们就可以给如果有需要使用更换CENTOS7系统源的,一般情况下拿到服务器之后不能直接update的我一般都会用国内的镜像源重新升级最新,这个也是防止系统安全。
原创文章,作者:管理员,如若转载,请注明出处:http://www.bajiege.com/system/centos/linux-centos7-x%e7%b3%bb%e7%bb%9f%e6%9b%b4%e6%8d%a2%e9%98%bf%e9%87%8c%e4%ba%91%e9%95%9c%e5%83%8f%e6%ba%90-%e9%87%8d%e6%96%b0%e6%9b%b4%e6%96%b0%e6%9c%80%e6%96%b0%e6%ba%90%e7%9a%84%e6%96%b9%e6%b3%95.html