Red hat 使用 CentOS 和yum源

简介:

/*** 转载自 Red hat 6使用 CentOS7 的yum和yum源 ***/



  1. 删除redhat原有的yum

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

 

  1. 下载yum安装文件

Wget 

Wget 

Wget 

Wget 

 

  1. 安装组件

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

rpm -ivhyum-metadata-parser-1.1.2-16.el6.x86_64.rpm

 

后面2个以前装的时候还失败鸟

# rpm -ivhyum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm

warning:yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm: Header V3 RSA/SHA1Signature, key ID c105b9de: NOKEY

error: Failed dependencies:

       yum >= 3.0 is needed by yum-plugin-fastestmirror-1.1.30-37.el6.noarch

# rpm -ivhyum-3.2.29-73.el6.centos.noarch.rpmyum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm

warning: yum-3.2.29-73.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-73.el6.centos.noarch

You have new mail in /var/spool/mail/root

 

  1. python组件

 

下载

 

# rpm -ivhpython-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

#

 

  1. 下载个python2.6重装

 

#rpm -e python-2.6.6-52.el6.x86_64 –nodeps

 

# rpm -ivh python-2.6.6-64.el6.x86_64.rpm

warning: python-2.6.6-64.el6.x86_64.rpm:Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY

error: Failed dependencies:

       python-libs(x86-64) = 2.6.6-64.el6 is needed bypython-2.6.6-64.el6.x86_64

#

 

 

  1. 继续修复依赖包

 

rpm -ivhpython-libs-2.6.6-64.el6.x86_64.rpm python-2.6.6-64.el6.x86_64.rpm

 

# rpm -ivhpython-libs-2.6.6-64.el6.x86_64.rpm python-2.6.6-64.el6.x86_64.rpm --nodeps

warning: python-libs-2.6.6-64.el6.x86_64.rpm:Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY

Preparing...               ########################################### [100%]

       file /usr/lib64/libpython2.6.so.1.0 from install ofpython-libs-2.6.6-64.el6.x86_64 conflicts with file from packagepython-libs-2.6.6-52.el6.x86_64

       file /usr/lib64/python2.6/CGIHTTPServer.py from install ofpython-libs-2.6.6-64.el6.x86_64 conflicts with file from packagepython-libs-2.6.6-52.el6.x86_64

       file /usr/lib64/python2.6/CGIHTTPServer.pyc from install ofpython-libs-2.6.6-

       file /usr/lib64/python2.6/distutils/sysconfig.pyc from install ofpython-libs-2.6.6-64.el6.x86_64 conflicts with file from package python-libs-2.6.6-52.el6.x86_64

       file /usr/lib64/python2.6/lib-dynload/_fileio.so from install ofpython-libs-2.6.6-64.el6.x86_64 conflicts with file from packagepython-libs-2.6.6-52.el6.x86_64

64.el6.x86_64 conflicts with file frompackage python-libs-2.6.6-52.el6.x86_64

You have new mail in /var/spool/mail/root

 

  1. 好像出错更多了,给你面子不要是吧,强制安装

 

# rpm -ivhpython-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%]

 

  1. Phtyon url 也要粗暴下

# rpm -ivhpython-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

# rpm -ivhpython-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%]

 

  1. 安装yum

# rpm -ivhyum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm

warning:yum-3.2.29-73.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key IDc105b9de: NOKEY

Preparing...               ########################################### [100%]

  1:yum-plugin-fastestmirro########################################### [50%]

  2:yum                   ########################################### [100%]

#

 

  1. 创建缓存

# yum makecache fast

Loaded plugins: fastestmirror, product-id,subscription-manager

This system is not registered to Red HatSubscription Management. You can use subscription-manager to register.

Metadata Cache Created

#

没有花钱买服务,果然没有订阅

 

  1. 查看版本

# yum --version

3.2.29

 Installed: rpm-4.8.0-37.el6.x86_64 at 2016-09-06 12:49

 Built    : Red Hat, Inc. at 2013-09-12 10:55

 Committed: Panu Matilainen at 2013-09-12

 

 Installed: subscription-manager-1.12.14-7.el6.x86_64 at 2016-09-06 12:52

 Built    : Red Hat, Inc. at 2014-09-15 20:34

 Committed: jesus m. rodriguez at 2014-09-15

 

 Installed: yum-3.2.29-73.el6.centos.noarch at 2016-09-15 00:36

 Built    : CentOS BuildSystem at 2016-05-11 20:37

 Committed: Johnny Hughes at 2016-05-10

 

 Installed: yum-plugin-fastestmirror-1.1.30-37.el6.noarch at 2016-09-1500:35

 Built    : CentOS BuildSystem at 2016-05-10 21:04

 Committed: Valentina Mukhamedzhanova at2016-02-10

#

 

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

# rpm -qa | grep subsc*

subscription-manager-gui-1.12.14-7.el6.x86_64

subscription-manager-1.12.14-7.el6.x86_64

subscription-manager-firstboot-1.12.14-7.el6.x86_64

# rpm -esubscription-manager-1.12.14-7.el6.x86_64

error: Failed dependencies:

       subscription-manager = 1.12.14-7.el6 is needed by (installed)subscription-manager-gui-1.12.14-7.el6.x86_64

You have new mail in /var/spool/mail/root

# rpm -qa | grep subsc*

subscription-manager-gui-1.12.14-7.el6.x86_64

subscription-manager-1.12.14-7.el6.x86_64

subscription-manager-firstboot-1.12.14-7.el6.x86_64

# rpm -qa | grep subsc* | xarge rpm -e--nodeps

-bash: xarge: command not found

You have new mail in /var/spool/mail/root

# rpm -qa | grep subsc* | xargs rpm -e--nodeps

#

 

 

  1. 下载repo文件

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

 

  1. 清空缓存新建缓存

[root@ActiveMQ-A yum.repos.d]# yum cleanall

Loaded plugins: fastestmirror

Cleaning repos: base extras updates

Cleaning up Everything

Cleaning up list of fastest mirrors

You have new mail in /var/spool/mail/root

[root@ActiveMQ-A yum.repos.d]# yummakecache

Loaded plugins: fastestmirror

Determining fastest mirrors

http://mirrors.163.com/centos/%24releasever/os/x86_64/repodata/repomd.xml:[Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 NotFound"

Trying other mirror.

To address this issue please refer to thebelow knowledge base article

 

https://access.redhat.com/articles/1320623

 

If above article doesn't help to resolvethis issue please open a ticket with Red Hat Support.

 

Error: Cannot retrieve repository metadata (repomd.xml)for repository: base. Please verify its path and try again

 

  1. repo release版本改为7,重新来

[root@ActiveMQ-A yum.repos.d]# yummakecache

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

base                                                                                                              |3.6 kB     00:00    

extras                                                                                                           | 3.4 kB     00:00    

updates                                                                                                           |3.4 kB     00:00    

updates/filelists_db                                                                                             | 4.4 MB     00:01     

updates/prestodelta                                                                                              | 700 kB     00:00    

updates/primary_db                                                                                               | 7.1 MB     00:01    

updates/other_db                                   (30%) 17%[=======                                 ] 2.9 MB/s |  11 MB     00:17 ETA











本文转自 chaunceyjiang  51CTO博客,原文链接:http://blog.51cto.com/cqwujiang/1876935,如需转载请自行联系原作者
目录
相关文章
|
5天前
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
54 25
|
1月前
|
缓存 Linux
CentOS-6的iso下载地址镜像yum源
通过上述步骤,您可以成功下载CentOS 6的ISO镜像文件,并配置适用于CentOS 6的YUM源。尽管CentOS 6已经停止更新,但使用这些镜像和YUM源配置,可以继续在需要的环境中使用和维护CentOS 6系统。
391 20
|
1月前
|
Linux
CentOs9 yum源出现404问题
CentOs9-stream yum源出现404问题
|
2月前
|
缓存 Linux
解决CentOS 7停止更新后yum源失效问题【图文教程】
以上步骤完成后,你的 CentOS 7 系统就会使用阿里云的 yum 源,更换yum以后就可以正常使用啦。
2131 2
|
4月前
|
Linux 虚拟化 开发者
一键将CentOs的yum源更换为国内阿里yum源
一键将CentOs的yum源更换为国内阿里yum源
7184 8
|
5月前
|
Linux
centos使用阿里的yum源
centos使用阿里的yum源
|
存储 关系型数据库 MySQL
Red Hat 安装MySQL 8.0与 Navicat
Red Hat 安装 MySQL 8.0 1、更新软件包列表 在添加 MySQL 存储库后,运行以下命令以更新软件包列表: sudo yum update 2、安装MySQL服务器和客户端 执行以下命令安装MySQL 8.0服务器和客户端软件包: sudo yum install -y mysql-server 3、启动MySQL服务 安装完成后,MySQL 服务器应该已经自动启动。如果没有启动,您可以运行以下命令手动启动服务: sudo systemctl start mysqld 启用 MySQL 服务的开机启动,可以运行以下命令: sudo systemctl enable mysqld
321 1
|
9月前
|
安全 Linux 网络安全
如何在 VM 虚拟机中安装 Red Hat Enterprise Linux 9.3 操作系统保姆级教程(附链接)
如何在 VM 虚拟机中安装 Red Hat Enterprise Linux 9.3 操作系统保姆级教程(附链接)
|
3月前
|
消息中间件 Linux RocketMQ
在Red Hat Enterprise Linux 9上使用Docker快速安装并部署
通过以上步骤,你可以在Red Hat Enterprise Linux 9上使用Docker快速安装并部署RocketMQ。这种方法不仅简化了安装过程,还提供了一个灵活的环境来管理和扩展消息队列系统。RocketMQ作为一款高性能的分布式消息系统,通过Docker可以实现快速部署和高效管理。
181 3
|
3月前
|
消息中间件 Linux RocketMQ
在Red Hat Enterprise Linux 9上使用Docker快速安装并部署
通过以上步骤,你可以在Red Hat Enterprise Linux 9上使用Docker快速安装并部署RocketMQ。这种方法不仅简化了安装过程,还提供了一个灵活的环境来管理和扩展消息队列系统。RocketMQ作为一款高性能的分布式消息系统,通过Docker可以实现快速部署和高效管理。
117 2

热门文章

最新文章