由于虚拟机的源为国外的,因此下载东西的时候常常会很慢,所以我们常常会更换为国内的源,本例用的是阿里源。
# 备份配置文件,防止错误
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backups
# 替换源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo
# 清除并重新生成缓存
yum clean all
yum makecache
来源:CSDN
作者:hellolxb
链接:https://blog.csdn.net/weixin_44116706/article/details/103754373