目 录CONTENT

文章目录

CentOS源修改为阿里云源

过客
2019-10-27 / 0 评论 / 0 点赞 / 8 阅读 / 0 字

1. 备份源文件

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

2. 查看CentOS版本号

cat /etc/redhat-release

3. 在阿里云镜像库找到符合自己centos版本的镜像源

# CentOS 5
wget -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

# CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

4. 重新加载

yum clean all
yum makecache 
0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin

评论区