一装系统就应该先换源,不然体验太难受了

官方的源基本上都在国外,速度慢的让人捉急

备份

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

ali yum

wget -o /etc/youm.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

二选一

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

网易163 yum

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

二选一

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

清除缓存

yum clean all

重建缓存

yum makecache 

更新

yum update


下载wget工具

yum install -y wget

进入yum源配置文件夹

cd /etc/yum.repos.d/

备份

mv CentOS-Base.repo CentOS-Base.repobak

ali yum

wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

网易163yum

wget -O CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

yum clean all
yum makecache 
yum update