This system is not registered with RHN替换RHEL的yum源,解决yum注册问题(小白练习)

这篇博客主要是为了锻炼自己写博客的能力,也希望能帮助一些急于处理这种问题的人,因为我写的内容很浅显,但是可以解决问题。

1.卸载rhel的yum相关的包

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

2.安装centos的源

# RHEL5适用

# RHEL6适用
下载先来的文件会在你当前所在的目录下,可用pwd查看当前所在路径位置,或者下载后使用
find  /  -name CentOS*
查找现在文件的位置
将下载的repo文件复制到/etc/yum.repo.d/,并重名为CentOS-Base.repo。
打开CentOS-Base.repo, 将$releaserver 为5(针对RHEL 5系列)或6(针对RHEL 6系列)

vim CentOS-Base.repo

# 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-$releasever - Base - 163.com
gpgcheck=1
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
gpgcheck=1
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
gpgcheck=1
替换后

# 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
gpgcheck=1
#released updates
[updates]
name=CentOS-6 - Updates - 163.com
gpgcheck=1
#additional packages that may be useful
[extras]
name=CentOS-6 - Extras - 163.com
gpgcheck=1

3.下载相关RPM包

密码:liei
是我自己的网盘文件,现在后放入Linux 自己指定的文件中,进行安装
安装顺序如下
#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
最后两个rpm包要同时安装,因为存在依赖关系

4.获取yum列表

最后
yum makecache

大功告成了!!!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值