[[email protected] ~]# vi /etc/yum.repos.d/rhel-source.repo
将這裡面的内容全部删掉(不删掉會出現問題,也可将源檔案重命名rhel-source.repo.back),替換成以下内容
[ base ]
name= CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/6 /os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#released updates
[ updates ]
name= CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/6 /updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
[ extras ]
name= CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/6 /extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[ centosplus ]
name= CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/6 /centosplus/$basearch/
gpgcheck=1
enabled=0 這裡也有要注意的地方,還是檔案名的問題,版本更替是一定的會有的,在此過程中可能會産生檔案名的更改,也許我現在可行的方法,到你用的時候就失效了,這時候你就得自己去核實路徑檔案名的正确與否了。因為我在這裡也出過錯,是以才能指出來,之前那些教程的baseurl路徑都是baseurl=http://mirrors.163.com/centos/6.0/centosplus/$basearch/ ,以前是命名為6.0,現在已經更改為6,是以之前這個檔案改好之後,在下一步進行驗證的時候,也是提示連接配接失敗。
這些内容更替好之後,儲存退出就可以了。
7、清除原來的源配置
[[email protected] ~]# yum clean all
9、更新yum源到本地
[[email protected] ~]# yum list
8、安裝現在的yum源,這一步也是測試新安裝的yum源有沒有安裝成功
[[email protected] ~]# yum install yum