通常我們安裝好Linux後,使用yum安裝和更新的時候,大部分的URL都是國外的地址,所以導致進度比較慢。其實,我們可以自己修改yum源,使用國內的yum源,這樣效率會更高。以163yum源爲例,其他與之類似:
1、首先下載好yum文件
wgethttp://mirrors.163.com/.help/CentOS6-Base-163.repo
2、備份並替換系統的REPO文件
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost ~]# mv CentOS-Base.repo CentOS-Base.repo.bak
[root@localhost ~]# mv CentOS6-Base-163.repo CentOS-Base.repo
3、執行yum源命令進行更新
[root@localhost ~]# yum clean all
root@localhost ~]# yum makecache
[root@localhost ~]# yum update
再次使用yum命令進行更新時,會發現速度比之前快了很多,由於不同的站點都有自己的yum源文件,所以導致會有不同的速度,這個屬於正常現象。
附錄:
阿里雲yum源下載地址:http://mirrors.aliyun.com/
163yum源使用幫助:http://mirrors.163.com/.help/centos.html