运维开发网

RHEL5.4_yum网络源配置

运维开发网 https://www.qedev.com 2020-03-06 11:19 出处:网络 作者:运维开发网整理
redhat默认是使用rpm安装,我们可以更改使用centos的yum网络源来进行安装。 一、删除redhat的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

0

精彩评论

暂无评论...
验证码 换一张
取 消