美文网首页
Centos 重新安装python和yum

Centos 重新安装python和yum

作者: pcoding | 来源:发表于2018-03-08 15:27 被阅读0次
    yum问题
    1. 卸载python
    rpm -qa|grep python|xargs rpm -e --allmatches --nodeps
    
    whereis python|xargs rm -fr
    
    1. 卸载yum
    rpm -qa|grep yum|xargs rpm -e --allmatches --nodeps
    
    rm -rf /etc/yum.repos.d/*
    
    whereis yum|xargs rm -fr
    
    1. 安装python
    mkdir /usr/local/src/python
    wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/python-2.6.6-66.el6_8.x86_64.rpm
    wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
    wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/python-pycurl-7.19.0-9.el6.x86_64.rpm
    wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/python-devel-2.6.6-66.el6_8.x86_64.rpm
    wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/python-libs-2.6.6-66.el6_8.x86_64.rpm
    wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
    wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/rpm-python-4.8.0-55.el6.x86_64.rpm
    rpm -ivh python-*   #rpm-python-* 
    
    如果中间过程出现了类似下面的代码,这是包与包之间的依赖关系,只需要卸载已经安装的包(rpm -e 包名(没有.rpm后缀)),然后先安装依赖包
    如:
          rpm -e yum-metadata-parser-1.1.2-16.el6.x86_64
          rpm -ivh /yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
    
    
    1. 安装yum
    mkdir /usr/local/src/yum
    wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm  
    wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm  
    wget http://mirrors.163.com/centos/6.9/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
    rpm -ivh yum-*
    
    1. 完成
    yum
    
    

    相关文章

      网友评论

          本文标题:Centos 重新安装python和yum

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