VPS侦探论坛

 找回密码
 注册
搜索
热搜: pathinfo
查看: 92276|回复: 2

[总结] Red Hat Enterprise Linux Server(RHEL) yum安装软件时This system is not registered with

[复制链接]
发表于 2012-5-8 11:24:18 | 显示全部楼层 |阅读模式

Red Hat Enterprise Linux Server(RHEL) 的yum服务是付费的,因为没有付费,所以无法使用yum安装软件,如RHEL想安装LNMP必须要先按此教程设置好yum,并可以正常使用后才可以安装LNMP一键安装包,会提示如下错误:This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. 或如下错误信息:This system is not registered with RHN. RHN support will be disabled.

解决方法:
执行:rpm -qa|grep yum|xargs rpm -e --nodeps  将yum卸载掉
cat /etc/issue && uname -a 看一下系统版本号和系统位数

http://mirrors.kernel.org/centos/http://mirrors.163.com/centos/ 找对应系统版本号

如果系统是5.* 64位,则打开http://mirrors.kernel.org/centos/5/os/x86_64/CentOS/
如果系统是5.* 32位,则打开http://mirrors.kernel.org/centos/5/os/i386/CentOS/
如果系统是6.* 32位:http://mirrors.kernel.org/centos/6/os/i386/Packages/
如果系统是6.* 32位:http://mirrors.kernel.org/centos/6/os/i386/Packages/

找到yum 、yum-fastestmirror、yum-metadata-parser 这3个软件包的地址,然后执行:以下命令下载地址可能会无法下载,到上面网址找对应的下载文件!下面是以RHEL 5.* 64位 为例,下面下载地址里的链接可能会变,自行更换下载地址
  1. wget http://mirrors.kernel.org/centos/5/os/x86_64/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm
  2. wget http://mirrors.kernel.org/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
  3. wget http://mirrors.kernel.org/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
复制代码
下载下这3个软件包,再执行:
rpm -ivh yum-*
再执行:(如果是6.*的版本,则将下面内容里面的5改成6,同时将下面文件里的$releasever全部替换为版本号5或6后再执行。)
  1. cat >/etc/yum.repos.d/CentOS-Base.repo<<eof
  2. [base]
  3. name=CentOS-$releasever - Base
  4. baseurl=http://mirrors.kernel.org/centos/$releasever/os/$basearch/
  5. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
  6. gpgcheck=1
  7. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  8. #released updates
  9. [updates]
  10. name=CentOS-$releasever - Updates
  11. baseurl=http://mirrors.kernel.org/centos/$releasever/updates/$basearch/
  12. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
  13. gpgcheck=1
  14. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  15. #packages used/produced in the build but not released
  16. [addons]
  17. name=CentOS-$releasever - Addons
  18. baseurl=http://mirrors.kernel.org/centos/$releasever/addons/$basearch/
  19. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
  20. gpgcheck=1
  21. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  22. #additional packages that may be useful
  23. [extras]
  24. name=CentOS-$releasever - Extras
  25. baseurl=http://mirrors.kernel.org/centos/$releasever/extras/$basearch/
  26. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
  27. gpgcheck=1
  28. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  29. #additional packages that extend functionality of existing packages
  30. [centosplus]
  31. name=CentOS-$releasever - Plus
  32. baseurl=http://mirrors.kernel.org/centos/$releasever/centosplus/$basearch/
  33. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
  34. gpgcheck=1
  35. enabled=0
  36. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

  37. #contrib - packages by Centos Users
  38. [contrib]
  39. name=CentOS-$releasever - Contrib
  40. baseurl=http://mirrors.kernel.org/centos/$releasever/contrib/$basearch/
  41. #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
  42. gpgcheck=1
  43. enabled=0
  44. gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
  45. eof
复制代码
再执行:yum makecache 生成缓存,再yum install 安装软件试试
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org/
发表于 2013-3-15 17:20:09 | 显示全部楼层

回复 1# 的帖子




如果按照这样的方法会不会导致RHEL更新成了CentOS?那还不如直接装CentOS呢,不是吗?求指教!
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org/
发表于 2014-8-14 15:41:54 | 显示全部楼层

谢谢军哥指点~




多谢多谢,我先试一把才看下效果。

[ 本帖最后由 zxytuo 于 2014-8-14 15:53 编辑 ]

美国VPS、VPN、域名代购:http://shop63846532.taobao.com/

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2019-5-25 08:07 , Processed in 0.179392 second(s), 26 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表