但行好事
莫论前程❤

更换RHEL6.1的yum为CentOS源

RDEL在使用yum的时候,会提示`未注册.导致不能使用yum安装程序.需要换掉yum源

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.

​ 默认RHEL是收费的,所以一般会把yum源换成CentOS的源.

  1. 下载Centos yum的四个安装包:

注: 具体地址视情况而定.版本迭代后会发生改变

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-69.el6.centos.noarch.rpm 
wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
  1. 卸载RHEL的yum

    -ivh 安装并打印详细信息

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-69.el6.centos.noarch.rpm  --nodeps
rpm -ivh yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
  1. 下载阿里云的开源镜像源:

-O 下载到指定路径并重命名

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
  1. 编辑Centos-6.repo即改名后的CentOS-Base.repo :将$releasever全部更换为 6.7(看具体版本而定,注意有些版本无镜像源
sed  -i 's/$releasever/6.7/g'  CentOS-Base.repo
  1. 清除全部,建立元数据缓存
yum clean all
yum makecache

꧁༺๑收工๑༻꧂

赞(1) 打赏
未经允许不得转载:刘鹏博客 » 更换RHEL6.1的yum为CentOS源
分享到: 更多 (0)

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏