標籤:
第一步:找到一個可靠的yum源
中科大
協助:https://lug.ustc.edu.cn/wiki/mirrors/help/centos
源:http://mirrors.ustc.edu.cn/centos/
搜狐
協助:http://mirrors.sohu.com/help/centos.html
源:http://mirrors.sohu.com/centos/
163
協助:http://mirrors.163.com/.help/centos.html
源:http://mirrors.163.com/centos/
第二步:配置yum源
在第一步中的各網站上的協助部分的連結下載類似於CentOS-Base.repo的檔案(就是網站在安裝說明中要求你該名稱此檔案名稱的檔案,具體名字可能根據不同的網站有所不同,內容應該都是一樣的。)
例如中科大的:
[[email protected] /]cd /etc/yum.repos.d[[email protected] yum.repos.d]wget https://lug.ustc.edu.cn/wiki/_export/code/mirrors/help/centos?codeblock=1
第三步:將CentOS-Base.repo中的$releasever替換成相應的版本
首先要保證被替換的版本下面有內容。
例如,我用的是紅帽6.2版本的系統,但是各個 第一步中的“源” 的連結中只有6.7裡面有內容。那麼我就把所有的$releasever替換成6.7
[[email protected] yum.repos.d]vim CentOS-Base.repovim命令模式下:1,$s/$releasever/6.7/g:wq
儲存退出
第四步:更新yum源
[[email protected] yum.repos.d]yum clean all[[email protected] yum.repos.d]yum makecache
結束
附錄:安裝epel也是同理
首先: 找到資源http://mirrors.opencas.cn/epel/,選擇好自己的系統版本和位元(32選i386/,64選x86_64/),然後下載到本地,如:
[[email protected] /]wget http://mirrors.opencas.cn/epel/6/x86_64/epel-release-6-8.noarch.rpm
然後:安裝好就行了
[[email protected] /]rpm -ivh epel-release-6-8.noarch.rpm
[[email protected] /]yum clean all
[[email protected] /]yum makecache
結束
如何配置CentOS或者RedHat5.X、6.X、7.X的網路yum源