1.备份原来的yum源
[root@localhost conf]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentOS-Media.repo CentOS-Sources.repo CentOS-Vault.repo CentOS-x86_64-kernel.repo
[root@localhost yum.repos.d]# mkdir yum
[root@localhost yum.repos.d]# mv *.repo yum2.下载阿里源镜像
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo3.清理原来的缓存更新阿里源
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache
[root@localhost yum.repos.d]# yum -y install epel-release查看安装的源
[root@localhost yum.repos.d]# yum repolist
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
源标识 源名称 状态
base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 10,072
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,758
extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 512
updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 4,053
repolist: 28,395
版权声明:本文为weixin_46627652原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。