解决redhat的未注册问题

昨天安装第五步的时候:开始是没有网,,,居然ping不通  网  ,服务器也ping不通,,,,,可能和我前几天删除了网络适配器有关,,把linux桥接对应的适配器给删了,,,

解决办法是打开虚拟网络编辑器 ,以管理员身份运行    删除vmnet0 再添加vmnet0 ,设置桥接方式,正常情况都会解决,,若还不行,,果断卸载VM,重装,,,避免时间浪费,      

一切设置好后,再来不签名的安装glibc的调试包,,,结果报错!!

yum --nogpgcheck --enablerepo=debug install glibc-debuginfo
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

------------------------------------------------------------

 经过研究发现,其实如果使用redhat的yum源需注册付费,费时费力,

解决办法一(未验证删除RHEL 6.7 的RHN注册和订阅提示

------------------------------------------------------------------------------------

     系统: RHEL 6.7 x64
    桌面: Gnome 
1. 查找RHN注册和订阅的程序组件。          
    (1) 查找subscription-manager相关组件:                 
      执行命令: rpm -qa|grep subscription-manager                 
       subscription-manager-gui-1.14.10-1.el6.x86_64
                  subscription-manager-1.14.10-1.el6.x86_64
                  subscription-manager-migration-1.14.10-1.el6.x86_64
                  subscription-manager-migration-data-2.0.22-1.el6.noarch
                  subscription-manager-firstboot-1.14.10-1.el6.x86_64       
    (2) 查找rhn相关组件:                 
      执行命令: rpm -qa|grep rhn                 
       rhnsd-4.9.3-2.el6.x86_64
                  rhn-check-1.0.0.1-32.el6.noarch
                  rhn-setup-gnome-1.0.0.1-32.el6.noarch
                  rhn-setup-1.0.0.1-32.el6.noarch
                  rhn-client-tools-1.0.0.1-32.el6.noarch
                  rhnlib-2.5.22-15.el6.noarch
                  yum-rhn-plugin-0.9.1-58.el6.noarch
2. 删除subscription-manager和rhn的相关程序组件。    
         (1) 执行命令: yum remove subscription-manager                   
        正在删除   : subscription-manager-firstboot-1.14.10-1.el6.x86_64              1/4 
                   正在删除   : subscription-manager-migration-1.14.10-1.el6.x86_64           2/4 
                   正在删除   : subscription-manager-gui-1.14.10-1.el6.x86_64                      3/4 
                   正在删除   : subscription-manager-1.14.10-1.el6.x86_64                             4/4              
   (2) 执行命令: yum remove rhn-check                   
       正在删除   : rhn-setup-gnome-1.0.0.1-32.el6.noarch                        1/5 
                   正在删除   : rhn-check-1.0.0.1-32.el6.noarch                                     2/5 
                   正在删除   : yum-rhn-plugin-0.9.1-58.el6.noarch                               3/5 
                   正在删除   : rhn-setup-1.0.0.1-32.el6.noarch                                      4/5 
                   正在删除   : rhnsd-4.9.3-2.el6.x86_64                                                  5/5 

这里不用rpm -e来删除程序是因为在执行删除任务的过程中会出现由于程序的相互依赖关系而无法删除的错误。
因此,用yum remove来执行删除任务,它会自动分析程序的相互依赖关系并删除。
 
      删除完后,直接用yum源安装!!!(未验证!)      有时间试一下看起作用不,,,,这几天太忙,等周六周日再看!
 
-----------------------------------------------------------------------------------------------------------------------------
方法二:卸载yum ,安装CentOS的rpm包,安装yum.  刷新yum缓存,yum makecache ,具体如下,
------------------------------------------------------------------------------------------------------------------

第一步下载相关安装包

可以通过http://mirrors.163.com/centos下载,

第二步卸载Redhat自带的yum

#rpm -qa | grep yum | xargs rpm -e --nodeps

第三步安装下载的安装包

#rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm

#rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

#rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

第四步到http://mirrors.163.com的 centos帮助文档 
中下载CentOS6-Base-163.repo文件,存放到/etc/yum.repos.d

#wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

第五步将Centos6-Base-163.repo中的$releasever改为Centos的版本号即可

为了防止错误,也可使用我已修改好的文件http://pan.baidu.com/s/1o6AZ23o

文件修改成如下即可:

# CentOS-Base.repo

#

# 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.

#

#

 

[base]

name=CentOS-6 - Base - 163.com

baseurl=http://mirrors.163.com/centos/6/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

 

#released updates

[updates]

name=CentOS-6 - Updates - 163.com

baseurl=http://mirrors.163.com/centos/6/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

 

#additional packages that may be useful

[extras]

name=CentOS-6 - Extras - 163.com

baseurl=http://mirrors.163.com/centos/6/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

 

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-6 - Plus - 163.com

baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

 

#contrib - packages by Centos Users

[contrib]

name=CentOS-6 - Contrib - 163.com

baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

第六步 yum clean all 清除原有缓存

第七步 yum makecache  获取yum列表

等待,大约三分钟后出现下面提示,表示yum更改完成:

Metadata Cache Created

 ----------------------------------------------------------------------------------------

其实也不用这么麻烦,

1.卸载redhat自带的yum组件      rpm -qa|grep yum|xargs rpm -e --nodeps

2.安装centos的yum包, 先浏览网页看版本号,再wget 对应的版本,(因为RHEL和CentOS 的关系,包都是一样的 ),  网页:http://centos.ustc.edu.cn/centos/ 下  对应版本  下,根据机器32位还是64位 装包
http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/
# wget http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
 
# wget  http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
 
# wget  http://centos.ustc.edu.cn/centos/6/os/x86_64/Packages/yum-3.2.29-73.el6.centos.noarch.rpm
 
3. 下载更新源,并存放在系统目录中 
 
wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo     http://docs.linuxtone.org这个网站里边存放了许多有用的资料,有机会可以看看
 
mv CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo
 
4. 更新yum 资源库
yum clean all
yum makecache   安装完成,下来就可以装调试包了, http://debuginfo.centos.org/6/x86_64/
---------------
linux 公社说  开发人员可以免费下载 Red Hat 企业版 Linux(RHEL)   免费领取RHEL7 的注册号   可以去下载一个备用
 
 
 
posted @ 2016-07-29 15:44  the_tops  阅读(12063)  评论(0编辑  收藏  举报