指定yum 源,不一定是Ping最快的源,但一定是下载最快的源
今天新装了一个CentOS的系统,习惯性的更新源,发现163或是sohu并不是最快的源,实际测试这2个是下载最快的约1M/S左右,但ping的time并不是最快的,CentOS给我指定了一个.tw的源...下载只有22K/S,昏死
yum clean all 清除yum所有缓存
更新yum更新源,加入163和sohu的
cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS-Base-163.repo
wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
yum makecache
如果给出的源不是163或是sohu,按2次ctrl+c取消,进行以下操作
既然你骗我,那我也骗骗你.哈哈
vi /var/cache/yum/timedhosts.txt
将163或是sohu,想用哪一个就把他后面的数改的比其他后面的数小就行,比如我的
centos.mirror.cdnetworks.com 0.0119969844818
ftp.tcc.edu.tw 0.0113589763641
centos.tt.co.kr 0.0114390850067
centos.ustc.edu.cn 0.0125939846039
mirrors.163.com 0.0011
ftp.twaren.net 0.0114319324493
mirror01.idc.hinet.net 0.0130698680878
ftp.stu.edu.tw 0.869683980942
ftp.isu.edu.tw 0.0126640796661
ftp.nsysu.edu.tw 0.0115549564362
mirrors.sohu.com 0.0026478672028
mirror.neu.edu.cn 0.0130610466003
我把mirrors.163.com的改成了0.0001 然后再
yum makecache
搞定
使用yum时就可以看到mirrors.163.com 的更新源
Repository updates is listed more than once in the configuration
Repository addons 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
Repository contrib is listed more than once in the configuration
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
Repository contrib is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* addons: mirrors.163.com
* base: mirrors.163.com
* epel: mirrors.ustc.edu.cn
* extras: mirrors.163.com
* updates: mirrors.163.com
Setting up Install Process
(责任编辑:IT) |