又是深夜了,晚上搞了一台華為雲的雲服務器(哦不是是昨天晚上),本來想着是華為本身就是做服務器的,所以在眾多大廠選擇了華為,可偏偏下載個上傳下載命令都不得,任何命令都是蝸牛,然后心里很不爽,怪不得阿里雲份額能超過你們幾個大廠總和,算了,不吐槽了,百度一番直接去改了阿里雲的鏡像源,步驟如下:
一、備份原來的鏡像源(其實沒必要)
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 以下,正常了。。,哎,睡眠時間總是不夠。。。