华为云yum镜像源超慢改用阿里云镜像遇坑解决方法

又是深夜了,晚上搞了一台华为云的云服务器(哦不是是昨天晚上),本来想着是华为本身就是做服务器的,所以在众多大厂选择了华为,可偏偏下载个上传下载命令都不得,任何命令都是蜗牛,然后心里很不爽,怪不得阿里云份额能超过你们几个大厂总和,算了,不吐槽了,百度一番直接去改了阿里云的镜像源,步骤如下:

一、备份原来的镜像源(其实没必要)

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缓存并重新生成缓存

yum clean all

yum makecache

 

本来想的是万事大吉,可是偏偏makecache都慢的要死,反正是没解决问题,然后注意到了一个叫做什么epel对应的mirror怎么还是日本的,想想就觉得不对,具体样子如下:

[root@hw yum.repos.d]# yum makecache

Loaded plugins: fastestmirror

Repository base is listed more than once in the configuration

Repository updates is listed more than once in the configuration

Repository extras is listed more than once in the configuration

Repository centosplus is listed more than once in the configuration

Determining fastest mirrors

epel/x86_64/metalink

* base: mirrors.aliyun.com

* epel: ftp.jaist.ac.jp

* extras: mirrors.aliyun.com

* updates: mirrors.aliyun.com

 

注意红色部分,然后就找度娘,各种yum epel的找,终于找到了解决办法,不知道是不是解决办法,反正下载变的像aliyun一样快了

 

四、添加阿里云的epel镜像源:

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

然后再去 yum clean all 、 yum makecache 以下,正常了。。,哎,睡眠时间总是不够。。。

posted @ 2022-04-08 18:01  oceanyang  阅读(796)  评论(0编辑  收藏  举报