RHEL5.4_yum網絡源配置

redhat默認是使用rpm安裝,我們可以更改使用centos的yum網絡源來進行安裝。


一、刪除redhat的yum所有組件


rpm -qa | grep yum | xargs rpm -e --nodeps     #用--nodeps參數強制刪除


二、下載yum組件


請查看附件下載


三、按照順序安裝下載的rpm包


rpm -ivh python-iniparse-0.2.3-4.el5.noarch.rpm &&

rpm -ivh yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm &&

rpm -ivh yum-3.2.22-26.el5.centos.noarch.rpm &&

yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm


四、創建yum的配置文件


vim /etc/yum.repos.d/CentOS-Base.repo


複製以下內容到該文件,保存即可完成。


[base]

name=CentOS-5 - Base

baseurl=http://centos.ustc.edu.cn/centos/5/os/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5


#released updates

[update]

name=CentOS-5 - Updates

baseurl=http://centos.ustc.edu.cn/centos/5/updates/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5


#packages used/produced in the build but not released

[addons]

name=CentOS-5 - Addons

baseurl=http://centos.ustc.edu.cn/centos/5/addons/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful

[extras]

name=CentOS-5 - Extras

baseurl=http://centos.ustc.edu.cn/centos/5/extras/$basearch/

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5


#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-5 - Plus

baseurl=http://centos.ustc.edu.cn/centos/5/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5


#contrib - packages by Centos Users

[contrib]

name=CentOS-5 - Contrib

baseurl=http://centos.ustc.edu.cn/centos/5/contrib/$basearch/

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5


#packages in testing

[testing]

name=CentOS-5 - Testing

baseurl=http://centos.ustc.edu.cn/centos/5/testing/$basearch/

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章