首页 > 其他 > 详细

CentOS更换源

时间:2019-04-05 15:56:22      阅读:124      评论:0      收藏:0      [点我收藏+]

这里介绍如何把CentOS默认镜像源更换为阿里云镜像源

 

1.备份

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

技术分享图片

  

2.下载新的CentOS-Base.repo 到 /etc/yum.repos.d/  (我这里用的CentOS 7.0)

CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo


CentOS 6 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo 或者 curl -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 或者 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

 技术分享图片

 

3、之后先清除缓存再生成缓存

# 清除缓存
yum clean all

# 生存缓存 yum makecache

技术分享图片

技术分享图片

 

  

  

 

CentOS更换源

原文:https://www.cnblogs.com/Chan94/p/10658756.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!