Centos7系统如何解决EPEL软件源国内下载慢问题

Centos7系统使用yum install epel-release命令安装EPEL软件源,EPEL软件源默认指定的地址是海外服务器,国内访问安装软件请求时下载速度很慢只有几KB到几十KB/S,有时可能因为网络问题还会导致下载超时,如何解决下载慢和超时的问题呢?写个教程记录下解决过程同时也给有需要的同学提供一丢丢帮助。

解决办法

我们可以操作替换成国内的镜像源,比如阿里云开源镜像源,华为云开源镜像源等等。使用哪个开源镜像源看自己喜欢,这边使用阿里云开源镜像源为例。

1、备份原本已有的epel镜像源(如果没有可以忽略此步骤)

mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup

2、下载新repo到/etc/yum.repos.d/目录

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

或者

curl -o /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo

3、清理并重建缓存

yum clean all
yum makecache

4、测试下载速度

yum makecache --disablerepo=* --enablerepo=epel

image.png

© 除非注明,否则均为阿豪运维笔记原创文章,转载或复制请以超链接形式并注明出处

取消
微信二维码
微信二维码
支付宝二维码