网站首页 安全运维 Centos7 换阿里云yum源
Centos7 换阿里云yum源
编辑时间:2019-12-31 22:01 作者:nllihui6390 浏览量:2444

为什么要将 centos 的 yum 源换了,因为真的太慢了!
换 yum 的步骤:

  • 更换之前确保自己安装wget

yum list wget
  • 若没有安装:

yum -y install wget
  • 备份原来的文件CentOS-Base.repo:给自己留条后路

  mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup1
  • 进入 yum.repos.d 目录

 cd /etc/yum.repos.d/1
  • 下载需要更新的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 clean allyum makecache1


  • 更新yum

yum -y update


来说两句吧
乖,登录后才可以留言!
最新评论