CentOS 7 yum 源改为阿里 的

来源:互联网 发布:阿里云怎么打开iis 编辑:程序博客网 时间:2024/05/21 18:43

1.安装base reop源

?
1
cd /etc/yum.repos.d

接着备份旧的配置文件

?
1
sudo mv CentOS-Base.repo CentOS-Base.repo.bak

下载阿里源的文件

?
1
sudo wget -O CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

2 安装epel repo源:

epel(RHEL 7)

?
1
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo

epel(RHEL 6)

?
1
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-6.repo

epel(RHEL 5)

?
1
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-5.repo

3.清理缓存

?
1
yum clean all

4.重新生成缓存

?
1
yum makecache
原创粉丝点击