美文网首页
centos6 软件yum安装与卸载

centos6 软件yum安装与卸载

作者: 公瑾丶醉 | 来源:发表于2017-04-12 17:31 被阅读0次

    当初想安装python2.7,直接干掉了系统默认的python2.6、和yum。后期想重新安装回来。花了好长时间才解决掉,网上的一些文章确实是坑,浪费了不少时间
    直接卸载python和yum
    rpm -qa | grep python | xargs rpm -e --nodepsrpm -qa | grep yum | xargs rpm -e --nodeps
    安装python2.6 需要的包

     python-2.6.6-64.el6.x86_64.rpm
     python-iniparse-0.3.1-2.1.el6.noarch.rpm
     python-libs-2.6.6-64.el6.x86_64.rpm
     python-pycurl-7.19.0-9.el6.x86_64.rpm
     python-urlgrabber-3.9.1-11.el6.noarch.rpm 
     rpm -ivh .rpm
    

    安装yum 所需软件包

    yum-3.2.29-73.el6.centos.noarch.rpm
    yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
     yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
    

    rpm -ivh yum- 会包缺少依赖包 忽略掉rpm -ivh yum- --force --nodepsforce 强制安装nodeps 取消依赖安装
    执行yum 命令

    There was a problem importing one of the Python modulesrequired to run yum. 
    The error leading to this problem was: No module named rpmPlease install a 
    package which provides this module, orverify that the module is installed correctly.
    

    rpm -qa | grep rpm查看是否缺少rpm-libs,*rpm-python俩个包。
    下载安装即可解决问题
    centos packages的下载地址,便于以后下载各种包使用
    http://mirrors.163.com/centos/6/os/x86_64/Packages/

    相关文章

      网友评论

          本文标题:centos6 软件yum安装与卸载

          本文链接:https://www.haomeiwen.com/subject/wrgmattx.html