本文主要是介绍修改RedHat的yum源为CentOS的yum源,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
今天需要用一个Linux系统做个测试,手头只有RHEL 5.4的光盘,装完以后,使用redhat系统在线安装时提示This system is not registered with RHN.如下:
[root@localhost ~]# yum install httpd
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
No package httpd available.
Nothing to do
解决方案:
1.卸载redhat自带的yum组件
[root@ser38 ~]# rpm -qa|grep yum|xargs rpm -e --nodeps
2.安装centos的yum包(32位/64位系统的下载包以及路径都不一样,我是64位系统对应于64位安装包)
[root@ser38 ~]# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
[root@ser38 ~]# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
[root@ser38 ~]# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm
[root@ser38 ~]# rpm -ivh *.rpm
warning: yum-3.2.22-39.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:yum-metadata-parser ########################################### [ 33%]
2:yum-fastestmirror ########################################### [ 67%]
3:yum ########################################### [100%]
3. 下载更新源,并存放在系统目录中
[root@ser38 ~]# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
[root@ser38 ~]#mv CentOS_Base.repo /etc/yum.repos.d/CentOS-Base.repo
4.生成缓存并进行安装
[root@ser38 ~]# yum makecache
[root@ser38 ~]# yum install httpd
这篇关于修改RedHat的yum源为CentOS的yum源的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!