当前位置: 首页 > news >正文

linux 全部卸载python yum 重新安装

为什么80%的码农都做不了架构师?>>>   hot3.png

Python升级导致yum不可用 “ No module named yum”

[root@localhost python]# 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 yum 
  
Please install a package which provides this module, or 
verify that the module is installed correctly. 
  
It's possible that the above module doesn't match the 
current version of Python, which is: 
2.7.13 (r266:84292, Jan 22 2014, 09:37:14)  
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] 
  
If you cannot solve this problem yourself, please go to  
the yum faq at: 
  http://yum.baseurl.org/wiki/Faq

解决办法:python和yum 全部卸载 重新安装

步骤1:卸载python

rpm -qa|grep python|xargs rpm -e --allmatches --nodeps

whereis python|xargs rm -fr

步骤2:卸载yum

rpm -qa|grep yum|xargs rpm -e --allmatches --nodeps

rm -rf /etc/yum.repos.d/*

whereis yum|xargs rm -fr

步骤3:安装python 和 yum

从linux安装包ISO文件中,查找到python和yum相关的rpm文件,上传到linux服务器

mkdir /usr/local/src/python
// 上传*python*.rpm 文件到此路径下

rpm -ivh --nodeps *python* 
mkdir /usr/local/src/yum
// 上传*yum*.rpm 文件到此路径下

rpm -ivh --nodeps *yum*

步骤4:测试

[root@localhost yum]# python
Python 2.6.6 (r266:84292, Feb 22 2013, 00:00:18) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
[root@localhost yum]# yum --version
3.2.29
  Installed: rpm-4.8.0-32.el6.x86_64 at 2018-01-30 09:44
  Built    : CentOS BuildSystem <http://bugs.centos.org> at 2013-02-22 02:13
  Committed: Florian Festi <ffesti@redhat.com> at 2012-11-15

  Installed: yum-3.2.29-40.el6.centos.noarch at 2018-02-02 06:27
  Built    : CentOS BuildSystem <http://bugs.centos.org> at 2013-02-22 11:26
  Committed: Johnny Hughes <johnny@centos.org> at 2013-02-21

  Installed: yum-plugin-aliases-1.1.30-14.el6.noarch at 2018-02-02 06:27
  Built    : CentOS BuildSystem <http://bugs.centos.org> at 2012-06-22 12:23
  Committed: Zdenek Pavlas <zpavlas@redhat.com> at 2012-04-26

  Installed: yum-plugin-fastestmirror-1.1.30-14.el6.noarch at 2018-02-02 06:27
  Built    : CentOS BuildSystem <http://bugs.centos.org> at 2012-06-22 12:23
  Committed: Zdenek Pavlas <zpavlas@redhat.com> at 2012-04-26

 

转载于:https://my.oschina.net/oosc/blog/1617379

相关文章:

  • 【进阶4-4期】Lodash是如何实现深拷贝的
  • 提问的艺术
  • git学习(一) 如何将项目上传到github
  • HTML和CSS第一篇
  • git的基本使用
  • Linux基础命令---显示路由表route
  • TCP的三次握手和四次挥手
  • 富文本
  • 记一次monolog的RotatingFileHandler使用
  • pandas中的iloc和loc的区别
  • iOS-多个UIScrollView滑动嵌套(仿微博、抖音、网易云个人详情页)
  • python3基础-字符串
  • 小李飞刀:SQL题目刷起来!
  • CentOS中制作本地yum源
  • 77. Combinations
  • 「面试题」如何实现一个圣杯布局?
  • 【comparator, comparable】小总结
  • 345-反转字符串中的元音字母
  • co.js - 让异步代码同步化
  • Docker下部署自己的LNMP工作环境
  • Java比较器对数组,集合排序
  • Laravel 菜鸟晋级之路
  • LeetCode29.两数相除 JavaScript
  • mysql常用命令汇总
  • Python socket服务器端、客户端传送信息
  • 大整数乘法-表格法
  • 聚类分析——Kmeans
  • 区块链分支循环
  • 如何用vue打造一个移动端音乐播放器
  • 如何在 Tornado 中实现 Middleware
  • 学习HTTP相关知识笔记
  • 一些关于Rust在2019年的思考
  • ​【已解决】npm install​卡主不动的情况
  • ​软考-高级-系统架构设计师教程(清华第2版)【第1章-绪论-思维导图】​
  • ![CDATA[ ]] 是什么东东
  • #HarmonyOS:软件安装window和mac预览Hello World
  • #laravel 通过手动安装依赖PHPExcel#
  • (3)选择元素——(14)接触DOM元素(Accessing DOM elements)
  • (JSP)EL——优化登录界面,获取对象,获取数据
  • (pojstep1.1.2)2654(直叙式模拟)
  • (windows2012共享文件夹和防火墙设置
  • (附源码)springboot电竞专题网站 毕业设计 641314
  • (附源码)计算机毕业设计大学生兼职系统
  • (九)One-Wire总线-DS18B20
  • (一)Spring Cloud 直击微服务作用、架构应用、hystrix降级
  • (转) Face-Resources
  • (转)JVM内存分配 -Xms128m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m
  • 、写入Shellcode到注册表上线
  • .Net 6.0 处理跨域的方式
  • .NET Reactor简单使用教程
  • .net获取当前url各种属性(文件名、参数、域名 等)的方法
  • .net与java建立WebService再互相调用
  • .pop ----remove 删除
  • .vollhavhelp-V-XXXXXXXX勒索病毒的最新威胁:如何恢复您的数据?
  • [23] 4K4D: Real-Time 4D View Synthesis at 4K Resolution