linux 更新yum源 改成阿里云源

Posted 孙大花

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux 更新yum源 改成阿里云源相关的知识,希望对你有一定的参考价值。

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 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 makecache生成缓存

以上是关于linux 更新yum源 改成阿里云源的主要内容,如果未能解决你的问题,请参考以下文章

linux 更新yum源 改成阿里云源

为各版本linux添加yum源

Linux修改yum源为阿里云网易中国科技大学

阿里云centos6.6怎么更新yum软件源升级php7

yum源

centos8将yum源更换为国内(阿里云)源