为什么要将 centos 的 yum 源换了,因为真的太慢了!
换 yum 的步骤:
-
- 备份原来的文件CentOS-Base.repo:给自己留条后路
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
- 进入 yum.repos.d 目录
cd /etc/yum.repos.d/
- 下载需要更新的yum源配置文件(或者自己下载,然后上传到 /etc/yum.repos.d/ 目录中)
centos 机器上下载命令:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
Windows机器上下载的网站:http://mirrors.aliyun.com/repo/Centos-7.repo
上传到 centos 机器
- 生成缓存
yum makecache
- 更新yum
yum -y update