CentOS 7更改yum源与更新系统

开源镜像

网易开源镜像镜像

网易开源镜像使用帮助: http://mirrors.163.com/.help

阿里云开源镜像

https://mirrors.aliyun.com/repo/

1、备份

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

2、下载CentOS-Base.repo 到/etc/yum.repos.d/

cd   /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

3、生成缓存

yum clean all
yum makecache

4、更新系统

更新系统时间可能会比较久取决于服务器网速

yum -y update
标签:YumCentos 发布于:2019-11-02 05:21:28