CentOS 7 更改 yum 源和 epel 源到阿里云

1.备份原来的yum源

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

2.设置yum源为阿里云

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

3.添加epel源

yum -y install epel-release
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

4.清理缓存并生成新的缓存

yum clean all
yum makecache

5.综合命令:

yum install wget -y
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install epel-release
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache

版权声明:
作者:三炮不吃鱼
链接:https://www.qkeke.com/archives/572.html
来源:小可博客
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
海报
CentOS 7 更改 yum 源和 epel 源到阿里云
1.备份原来的yum源 yum install wget -y mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2.设置yum源为阿里云 wget -O /et……
<<上一篇
下一篇>>