用了第一种方法就解决了,
-------------------------我是一道寂寞的分割线---------------------------------
问题:红帽中出现This system is not registered with RHN这个的原因是因为红帽中没有注册RHN。
解决办法一:
(假定你已安装yum,且网络畅通)更改yum的源,即更换/etc/yum.repos.d/rhel-debuginfo.repo 这个文件。
进入/etc/yum.repos.d/目录,终端中输入wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo即可在此目录下得到CentOS-Base.repo文件,这是centos的源文件,只需将其重命名为rhel-debuginfo.repo即可,以前的文件做个备份。
解决办法二:
1.卸载redhat自带的yum组件
[root@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps
2.安装centos的yum包
32位
# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-16.el5.centos.noarch.rpm
# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-37.el5.centos.noarch.rpm
64位
# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
# wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm
[root@localhost ~]# rpm -ivh *.rpm
3. 下载更新源,并存放在系统目录中 [root@localhost ~]# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
[root@localhost ~]#mv CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo
4.生成缓存
[root@localhost ~]# yum makecache