錯誤信息:
root@localhost ipvsadm-1.25]# yum install gcc
Loading "security" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Parsing package install arguments
No package gcc available.
Nothing to do
[root@localhost ipvsadm-1.25]#
紅帽中出現"This system is not registered with RHN"這個的原因是因爲紅帽中沒有註冊RHN。
解決辦法:(假定你已安裝yum,且網絡暢通)更改yum的源,
即更換/etc/yum.repos.d/rhel-debuginfo.repo 這個文件。首先備份,如下所示:
[root@localhost yum.repos.d]# ls /etc/yum.repos.d/rhel-debuginfo.repo.bak
進入/etc/yum.repos.d/目錄,終端中輸入
wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
再看目下有什麼文件:
[root@localhost yum.repos.d]# ls /etc/yum.repos.d/
CentOS-Base.repo rhel-debuginfo.repo.bak
即可在此目錄下得到CentOS-Base.repo文件,這是centos的源文件,然後測試看看yum是否可以使用了,
如果還是不可以的話,只需將其重命名爲rhel-debuginfo.repo即可。