美文网首页
更换阿里云yum源

更换阿里云yum源

作者: 殷临风 | 来源:发表于2016-12-27 16:03 被阅读250次

CentOS 自带的yum速度很慢, 一般而言我们会选择第三方的镜像, 阿里云是一个不错的选择

  • 删除原有的yum
# 卸载原有的epel
rpm -e epel-release
# 删除所有repo (当然你如果不放心, 可以备份)
rm -rf /etc/yum.repos.d/*
  • 下载 repo
# centos-6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# centos-7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  • 安装 epel
# centos-6
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
# centos-7
yum -y install epel-release
或
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
  • 清空并生成缓存
yum clean all
yum makecache

此时执行 yum update 发现下载速度非常快

相关文章

网友评论

      本文标题:更换阿里云yum源

      本文链接:https://www.haomeiwen.com/subject/qkhevttx.html