更改CentOS yum 源爲163的源

CentOS下能夠經過yum很方便快捷的安裝所需的軟件和庫,若是yum的源很差,安裝速度會很是慢,CentOS默認官方源彷佛都是國外的,因此速度沒法保證,我一直使用163的源,感受速度不錯。下面就說說如何修改yum的源。html


一、進入存放源配置的文件夾
    cd /etc/yum.repos.d

二、備份默認源
    mv ./CentOS-Base.repo ./CentOS-Base.repo.backup

三、使用wget下載163的源
    wget http://mirrors.163.com/.help/CentOS-Base-163.repo

四、把下載下來的文件CentOS-Base-163.repo設置爲默認源
    mv CentOS-Base-163.repo CentOS-Base.repo

經過上述操做就把默認源修改成163的了。固然上述的操做能夠合併爲以下:centos

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
    wget http://mirrors.163.com/.help/CentOS-Base-163.repo -O /etc/yum.repos.d/CentOS-Base.repo



參考地址: spa

http://mirrors.163.com/.help/centos.html .net

http://www.netingcn.com/update-centos-yum-source.htmlcode

相關文章
相關標籤/搜索