红帽中出现This system is not registered with RHN这个的原因是因为红帽中没有注册RHN。解决办法:(假定你已安装yum,且网络畅通)更改yum的源,即更换/etc/yum.repos.d/rhel-debuginfo.repo 这个文件。进入/etc/yum.repos.d/目录,终端中输入wget 即可在此目录下得到CentOS-Base.repo文件,这是centos的源文件,只需将其重命名为rhel-debuginfo.repo即可,以前的文件做个备份。
=====================================================================================
下面是针对rhel5.6上进行的修改
1.删除RHEL上自带的yum.
rpm -aq|grep yum|xargs rpm -e –nodeps
2.下载所需的rpm包
wget
wget
wget
wget
上面总共有四个包,如果CentOS更新至5.7或5.8之类的这个包的地址是会改变的,或者最新的yum的软件版本有变,请到 对应的目录下找到同样的软件包,也许他们的版本号会有所不同。
3.安装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-33.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
注意:第三步一定要两个一起装。否则会出现错误!
4.下载配置源
#cd /etc/yum.repos.d/
网上有说到:wget 下载该配置源,但这个地址已经失效。
下面我把该源的全部内容贴出来。
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# 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.
#
#
# CentOS-Base.repo
[base]
name=CentOS-$releasever – Base
baseurl=
gpgcheck=1
gpgkey=
#released updates
[update]
name=CentOS-$releasever – Updates
baseurl=
gpgcheck=1
gpgkey=
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever – Addons
baseurl=
gpgcheck=1
gpgkey=
#additional packages that may be useful
[extras]
name=CentOS-$releasever – Extras
baseurl=
gpgcheck=1
gpgkey=
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever – Plus
baseurl=
gpgcheck=1
enabled=0
gpgkey=
#contrib – packages by Centos Users
[contrib]
name=CentOS-$releasever – Contrib
baseurl=
gpgcheck=1
enabled=0
gpgkey=
#结束
注意:#开始 和 #结束可以不要的。这里是为了说明这个内容的起始位置。
5.好像是注册KEY之类的。
rpm –import yum update
但该文章在网上找不到,在CentOS ISO镜像的根目录下有该的文件:RPM-GPG-KEY-CentOS-5 你可以将该文件传到服务器上,或通过其它渠道传至RHEL主机上。反正执行这一条就可以了。
最后:就可以执行yum了。
阅读(967) | 评论(0) | 转发(0) |