起因是安装好RedHat后就准备装一些服务,于是使用yum命令的时候提示说:
This system is not registered to Red Hat Subscription Management.You can use subscription-manager to register.
好嘛,原来是因为RedHat使用yum源需要付费......在网上找了使用CentOS源替换的方法。中途出现几次错误,最后解决了,但具体是哪一步出错又是在哪一步解决,这个暂时还不清楚。先把完整步骤记录下来,按这个操作一遍最后肯定是可以的,就是过程会有点曲折= =。
1.删除redhat自带的yum包
检查是否安装了yum包,如果安装了,显示有哪些包。
rpm -qa | grep yum (检查是否安装yum包)
rpm -qa | grep yum | xargs rpm -e --nodeps (不检查依赖,直接删除rpm包)
rpm -qa | grep yum
2.使用CentOS的包来代替
我的红帽系统版本是7.2,然后我选择的是CentOS7的版本来代替。
镜像地址: http://mirrors.163.com/centos/
可以根据系统版本选择对应的软件包进行下载。比如我系统是64,下载的是http://mirrors.163.com/centos/7/os/x86_64/Packages/目录下这五个包:(具体要用到几个包我也不清楚,有的博客说四个包就够了,有的又说需要另外的包。所以我就都