centos6 软件yum安装与卸载

由于当初想安装python2.7,直接干掉了系统默认的python2.6、和yum。后期想重新安装回来。花了好长时间才解决掉,网上的一些文章确实是坑,浪费了不少时间。

直接卸载python和yum 

rpm -qa | grep python | xargs rpm -e --nodeps
rpm -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-* 会包缺少依赖包  忽略掉
rom -ivh yum-* --force --nodeps
force 强制安装
nodeps 取消依赖安装
执行yum 命令
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named rpm

Please install a package which provides this module, or
verify 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/
 
posted @ 2017-02-09 11:34  买丶醉  阅读(423)  评论(0编辑  收藏  举报