linux 全部卸载python yum 重新安装
2018-02-02 00:00
501 查看
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[/code] 解决办法:python和yum 全部卸载 重新安装
步骤1:卸载pythonrpm -qa|grep python|xargs rpm -e --allmatches --nodeps whereis python|xargs rm -fr
步骤2:卸载yumrpm -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
相关文章推荐
- centos重新安装,卸载python yum
- 每天学一点linux:Centos中yum安装和卸载软件的命令
- linux下php快速升级 5.2.6(1)用yum(2)重新编译安装
- 在linux上用yum安装和卸载mongodb 3.0数据库
- Linux命令之软件的安装与卸载-rpm,dpkg,yum
- linux下yum安装和卸载nginx
- linux下 yum 安装mysql和卸载
- 卸载yum后如何重新安装
- linux安装软件(rpm/yum/apt-get/python)等解决依赖问题
- Linux 中 RPM包 安装 查询 卸载命令小结及yum命令详解
- [转]Linux下RPM软件包的安装及卸载 yum操作
- [Linux]在Centos中yum安装和卸载软件的使用方法
- linux下卸载自带jdk,重新安装jre运行环境
- linux下 yum 安装mysql和卸载
- linux yum rpm 和 apt-get dpkg 安装、卸载软件
- linux中安装新版本python之后yum无法使用的问题
- Red Hat Linux卸载旧版本的JDK安装新版本的JDK并附yum安装
- linux上python2.7.11 和 3.6.2 编译安装时系统要预先安装的包(centos 用 yum安装即可)
- linux 用yum安装软件和卸载软件
- Linux系统下卸载JDK 重新安装新版本