设为首页 收藏本站
查看: 520|回复: 0

[经验分享] Red hat 使用 CentOS 和yum源

[复制链接]

尚未签到

发表于 2018-4-24 10:09:32 | 显示全部楼层 |阅读模式
  /*** 转载自 Red hat 6使用 CentOS7 的yum和yum源 ***/

  •   删除redhat原有的yum
  rpm -aq|grep yum|xargs rpm -e –nodeps

  •   下载yum安装文件
  Wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-73.el6.centos.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-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
  Wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

  •   安装组件
  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>  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>  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

  •   少python组件
  下载
  http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
  # 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>  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重装
  http://mirrors.163.com/centos/6/os/x86_64/Packages/python-2.6.6-64.el6.x86_64.rpm
  #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>  error: Failed dependencies:
  python-libs(x86-64) = 2.6.6-64.el6 is needed bypython-2.6.6-64.el6.x86_64
  #

  •   继续修复依赖包
  http://mirrors.163.com/centos/6/os/x86_64/Packages/python-libs-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
  # 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>  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

  •   好像出错更多了,给你面子不要是吧,强制安装
  # 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>  Preparing...               ########################################### [100%]
  1:python                ########################################### [ 50%]
  2:python-libs           ########################################### [100%]

  •   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>  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>  Preparing...               ########################################### [100%]
  1:python-urlgrabber     ########################################### [100%]

  •   安装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>  Preparing...               ########################################### [100%]
  1:yum-plugin-fastestmirro########################################### [50%]
  2:yum                   ########################################### [100%]
  #

  •   创建缓存
  # 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
  #
  没有花钱买服务,果然没有订阅

  •   查看版本
  # yum --version
  3.2.29
  Installed: rpm-4.8.0-37.el6.x86_64 at 2016-09-06 12:49
  Built    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>at 2013-09-12 10:55
  Committed: Panu Matilainen <pmatilai@redhat.com> at 2013-09-12
  Installed: subscription-manager-1.12.14-7.el6.x86_64 at 2016-09-06 12:52
  Built    : Red Hat, Inc.<http://bugzilla.redhat.com/bugzilla> at 2014-09-15 20:34
  Committed: jesus m. rodriguez <jesusr@redhat.com> at 2014-09-15
  Installed: yum-3.2.29-73.el6.centos.noarch at 2016-09-15 00:36
  Built    : CentOS BuildSystem<http://bugs.centos.org> at 2016-05-11 20:37
  Committed: Johnny Hughes <johnny@centos.org> at 2016-05-10
  Installed: yum-plugin-fastestmirror-1.1.30-37.el6.noarch at 2016-09-1500:35
  Built    : CentOS BuildSystem<http://bugs.centos.org> at 2016-05-10 21:04
  Committed: Valentina Mukhamedzhanova <vmukhame@redhat.com> at2016-02-10
  #

  •   订阅就不要了,反正也没钱
  # 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
  #

  •   下载repo文件
  http://mirrors.163.com/.help/CentOS7-Base-163.repo

  •   清空缓存新建缓存
[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


  •   把repo>
[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

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-451249-1-1.html 上篇帖子: centos ipmitool安装 下篇帖子: Centos 6.5本地Yum和网络Yum
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表