前段时间在Linux上安装PHP,感觉CentOS的yum很好很强大,无奈RedHat Enterprise4/5是商业收费版,无法使用yum功能,于是想到在redhat上使用centos的源,方法如下:
#rpm -qa | grep yum
显示系统已装的yum有关软件,我的是:
yum-rhn-plugin-0.5.3-30.el5
yum-3.2.19-18.el5
yum-security-1.1.16-13.el5
yum-updatesd-0.9-2.el5
yum-metadata-parser-1.1.2-2.el5
然后使用
#rpm -e ****
命令删除,必要时使用 --nodeps
在centos安装文件中找到以下的rpm文件:
yum-3.2.22-26.el5.centos.noarch.rpm
yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
yum-updatesd-0.9-2.el5.noarch.rpm
网上说redhat的内核版本需要和centos的相对应,如:
#uname -r
我的是 2.6.18-128.el5
对照网上的资料,需要找到centos5.3,但手上暂时没有,只有一个centos5.5的,先用着,不知道有没有什么问题。
然后再redhat中执行:
#rpm -ivh *.rpm
删除/etc/yum.repos.d/rhel-debuginfo.repo文件,
创建文件:CentOS-Base.repo,
#vi CentOS-Base.repo
######################
[base]
name=CentOS-5 - Base
repo=os
baseurl=http://centos.ustc.edu.cn/centos/5/os/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[update]
name=CentOS-5 - Updates
baseurl=http://centos.ustc.edu.cn/centos/5/updates/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[addons]
name=CentOS-5 - Addons
baseurl=http://centos.ustc.edu.cn/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[extras]
name=CentOS-5 - Extras
baseurl=http://centos.ustc.edu.cn/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[centosplus]
name=CentOS-5 - Plus
baseurl=http://centos.ustc.edu.cn/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[contrib]
name=CentOS-5 - Contrib
baseurl=http://centos.ustc.edu.cn/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
###################
然后保存退出。
OK,搞定
20130906附加问题:
1、执行yum,下载的rpm包存放在 /var/cache/yum下
2、red hat enterprise linux 5.9使用centos 5.9的yum时,CentOS-Base.repo中的内容不可用,提示无法使用镜像地址,可能是版本的原因,也可能是时间长了,镜像地址变了。
修改后CentOS-Base.repo文件内容:
[root@localhost yum.repos.d]# cat CentOS-Base.repo # CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-5 - Base - 163.com mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os baseurl=http://mirrors.163.com/centos/5/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 #released updates [updates] name=CentOS-5 - Updates - 163.com mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=updates baseurl=http://mirrors.163.com/centos/5/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 #packages used/produced in the build but not released [addons] name=CentOS-5 - Addons - 163.com mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=addons baseurl=http://mirrors.163.com/centos/5/addons/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 #additional packages that may be useful [extras] name=CentOS-5 - Extras - 163.com mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=extras baseurl=http://mirrors.163.com/centos/5/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-5 - Plus - 163.com mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=centosplus baseurl=http://mirrors.163.com/centos/5/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 #contrib - packages by Centos Users [contrib] name=CentOS-5 - Contrib - 163.com mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=contrib baseurl=http://mirrors.163.com/centos/5/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
可用。
相关推荐
介绍如何在RHEL5没有subscription的情况下换用centos yum源
亲自解决公司yum问题,特别研究编著.解决redhat在5.0及6.0的yum使用问题。
linux redhat centos修改yum下载源.zip
内含需要安装的rpm包和修改后的yum源配置。 python-urlgrabber-3.9.1-11.el6.noarch.rpm yum-3.2.29-40.el6.centos.noarch.rpm yum-metadata-parser-1.1.2-16.el6.i686.rpm yum-metadata-parser-1.1.2-16.el6.x86_64...
这是最新的redhat5.1配置centos yum的教程,将redhat的收费yum替换成centos免费yum,里面的软件下载地址是最新的(2014-02-28),大家可以直接wget使用,如果提示不可用可能是格式问题,建议先复制到记事本然后在粘贴...
redhat7替换使用CentOS yum源--博客附件;方便下载,改为1积分,CSDN好像最低就是1积分! 大家别下了,我怕资源失效,文章写好久了
Redhat 使用CentOS的yum源进行升级或软件安装 分类: linux 2012-07-19 15:54 1113人阅读 评论(0) 收藏 举报 Redhat默认的源不但速度不给力,而且软件版本陈旧,今天试着将Redhat默认源替换为CentOS的163源,发现...
redhat 6系列的自带的yum需要在官网注册付费才能使用,网上的换yum源教程里的资源下载路径都过期了,现在将这4个文件一起打包提供下载。
redhat7使用yum需要收费,不能直接使用,需要使用centos7的yum源,本人看了一些文档和博客总结成了这个方法,成功地为redhat7配置好了yum,这个压缩包中包含配置yum的方法以及用到的文件,需要提前安装python,我的linux安...
redhat更改为centOS-6.4 yum源相关安装包
通用版redhat6或者centos6的yum源
Red Hat Enterprise Linux7的更新包只对注册的用户生效,所以需要自己手动改成Centos的更新包,Centos几乎和和Redhat是一样的,所以无需担心软件包的兼容问题。
RedHat 5.3配置YUM 从centos5源与光盘源更新软件
redhat7.9 + yum.repos.d +CentOS7-Base-163.repo + Centos-7-aliyun.repo
# 删除redhat自带的yum包 rpm -qa|grep yum|xargs rpm -e --nodeps # 安装yum软件包 # 注意:单个的安装包可能会依赖其它包(例如yum和yum-fastestmirror会相互依赖),所以我们可以把所有这些包放在一起,用一行...
将redhat linux下收费yum源改为centos免费Yum源 有上网找的yum源软件包下载地址,直接就可以用
该资料包提供了在redhat/centos 6版本上安装createrepo命令所需的rpm包,并提供安装说明文档,以及如何配置制作yum本地源的指导文档。
redhat6和centos6通用阿里云yum源文件,已配置好的文件,下载解压,拷贝到/etc/yum.repos.d/目录,执行yum clean all命令。即可使用yum网络源。