RedHat6.6 更换CentOS6 yum和yum源

redhat默认自带的yum源需要注册,才能更新,报错:
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
可替换为centos对应的源。 操作如下:

 

1、删除redhat原有的yum

 

rpm -aq|grep yum|xargs rpm -e –nodeps

 

 

2、下载yum安装文件

 

 

3、安装组件

 

 

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-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
warning: yum-3.2.29-81.el6.centos.noarch.rpm:Header V3 RSA /SHA1 Signature, key ID c105b9de: NOKEY
error: Failed dependencies:
        python-urlgrabber >= 3.9.1-10 is needed byyum-3.2.29-81.el6.centos.noarch
You have new mail in /var/spool/mail/root

 


少python-urlgrabber 组件,下载:

 

http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm

 

# rpm -ivh python-urlgrabber- 3.9 . 1 - 11 .el6.noarch.rpm
warning:python-urlgrabber- 3.9 . 1 - 11 .el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key IDc105b9de: NOKEY
Preparing...               ########################################### [ 100 %]
        file /usr/lib/python2. 6 /site-packages/urlgrabber/grabber.py from installof python-urlgrabber- 3.9 . 1 - 11 .el6.noarch conflicts with file from packagepython-urlgrabber- 3.9 . 1 - 9 .el6.noarch
        file /usr/lib/python2. 6 /site-packages/urlgrabber/grabber.pyc frominstall of python-urlgrabber- 3.9 . 1 - 11 .el6.noarch conflicts with file frompackage python-urlgrabber- 3.9 . 1 - 9 .el6.noarch
        file /usr/lib/python2. 6 /site-packages/urlgrabber/grabber.pyo frominstall of python-urlgrabber- 3.9 . 1 - 11 .el6.noarch conflicts with file frompackage python-urlgrabber- 3.9 . 1 - 9 .el6.noarch
        file /usr/lib/python2. 6 /site-packages/urlgrabber/progress.pyc frominstall of python-urlgrabber- 3.9 . 1 - 11 .el6.noarch conflicts with file frompackage python-urlgrabber- 3.9 . 1 - 9 .el6.noarch
        file /usr/lib/python2. 6 /site-packages/urlgrabber/progress.pyo frominstall of python-urlgrabber- 3.9 . 1 - 11 .el6.noarch conflicts with file frompackage python-urlgrabber- 3.9 . 1 - 9 .el6.noarch


 

 

 

下载个python2.6重装

 

wget ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6.5/x86_64/updates/security/python-2.6.6-64.el6.x86_64.rpm

 ----查看当前python rpm版本----


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

#rpm -e python-2.6.6-52.el6.x86_64 --nodeps
# rpm -ivh python-2.6.6-64.el6.x86_64.rpm

 

有报错,需要依赖包,继续

# rpm -ivh python-libs- 2.6 . 6 - 64 .el6.x86_64.rpm python- 2.6 . 6 - 64 .el6.x86_64.rpm --nodeps  --force


 

warning:python-libs- 2.6 . 6 - 64 .el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key IDc105b9de: NOKEY
Preparing...               ########################################### [ 100 %]
   1 :python                ########################################### [ 50 %]
   2 :python-libs           ########################################### [ 100 %]

没问题,可以继续

 

Phtyon url 也要粗暴下

# rpm -ivh python-urlgrabber- 3.9 . 1 - 11 .el6.noarch.rpm --nodeps --force
warning:python-urlgrabber- 3.9 . 1 - 11 .el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key IDc105b9de: NOKEY
Preparing...               ########################################### [ 100 %]
   1 :python-urlgrabber     ########################################### [ 100 %]


 

 

 

安装yum

 

# rpm -ivh yum- 3.2 . 29 - 81 .el6.centos.noarch.rpm yum-plugin-fastestmirror- 1.1 . 30 - 37 .el6.noarch.rpm
warning:yum- 3.2 . 29 - 81 .el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key IDc105b9de: NOKEY
Preparing...               ########################################### [ 100 %]
   1 :yum-plugin-fastestmirro########################################### [ 50 %]
   2 :yum                   ########################################### [ 100 %]

 

 

 

 订阅就不要了,反正也没钱


# rpm -qa | grep subsc*
subscription-manager- 1.12 . 14 - 7 .el6.x86_64
# rpm -e subscription-manager- 1.12 . 14 - 7 .el6.x86_64

4、设置yum

下载repo文件 到  /etc/yum.repos.d/

http://mirrors.163.com/.help/CentOS7-Base-163.repo

 把文件里面的$releasever全部替换为版本号:6

清除原有缓存,重建缓存,更新

  1.     yum clean all

  2.     yum makecache

  3.     yum update

 

 

 


    完成

参考

 

 

 

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要将RedHat 7.2更换CentOS 7的yum源,可以按照以下步骤操作: 1. 卸载RedHat原有的yum源: 使用命令`rpm -qa | grep yum`查看已安装的yum软件包。 使用命令`rpm -qa | grep yum | xargs rpm -e --nodeps`卸载已安装的yum软件包。 2. 下载CentOSyum源: 前往CentOS镜像站点,例如阿里云镜像站点`https://mirrors.aliyun.com/centos/`,找到对应版本的yum源地址。 在镜像站点中找到合适的版本,例如CentOS 7的yum源码地址为`https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/`。 根据需求选择需要下载的包,例如`python-urlgrabber-3.10-10.el7.noarch.rpm`、`yum-3.4.3-167.el7.centos.noarch.rpm`等。 使用命令`wget`或其他下载工具下载所需的包。 3. 安装下载的CentOSyum源: 执行命令`rpm -ivh --force *.rpm`来安装下载的所有包。 由于这些包之间存在依赖关系,所以需要使用`--force`参数来强制安装。 现在,你已经成功将RedHat 7.2更换CentOS 7的yum源。你可以通过使用命令`rpm -qa | grep yum`来验证新的yum源已经安装成功。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Red hat7替换centos7的Yum源](https://blog.csdn.net/qq_42956179/article/details/109618774)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [Redhat7更换centos7的yum源方法步骤](https://blog.csdn.net/weixin_43837883/article/details/89179533)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值