1. 程式人生 > >Centos更換yum源,使用國內163源

Centos更換yum源,使用國內163源

這裡以使用163源為例


確保已安裝 下載元件wget

yum -y install wget


先備份/etc/yum.repos.d/CentOS-Base.repo (改名)

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup


切換到目錄/etc/yum.repos.d下載repo檔案, (http://mirrors.163.com/.help/centos.html)

wget http://mirrors.163.com/.help/CentOS6-Base-163.repo   (在哪個目錄執行wget 就下載在哪裡 )

改名
mv /etc/yum.repos.d/CentOS6-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo

生成快取
yum clean all

yum makecache

參考官方說明: