已解决
Centos7 Python环境和yum修复
来自网友在路上 11008100提问 提问时间:2023-11-23 22:58:42阅读次数: 100
最佳答案 问答题库1008位专家为你答疑解惑
1、删除现有残余包
[root@localhost ]# rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps[root@localhost ]# rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps[root@localhost ]# whereis python |xargs rm -frv[root@localhost ]# whereis python ##验证清除,返回无结果代表清除完成
2、下载安装包
下载安装包,上传至/opt/tools
[root@localhost ]# wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz[root@localhost ]# tar -zxvf Python-2.7.5.tgz
3、解压安装
[root@localhost ]# tar -zxf python2.7.5-yum.tar.gz[root@localhost ]# cd python2.7.5-yum[root@localhost ]# rpm -Uvh --replacepkgs *.rpm --nodeps --force准备中... ################################# [100%]正在升级/安装...1:python-libs-2.7.5-86.el7 ################################# [ 6%]2:python-2.7.5-86.el7 ################################# [ 13%]3:python-chardet-2.2.1-3.el7 ################################# [ 19%]4:python-kitchen-1.1.1-5.el7 ################################# [ 25%]5:python-pycurl-7.19.0-19.el7 ################################# [ 31%]6:python-urlgrabber-3.10-9.el7 ################################# [ 38%]7:rpm-python-4.11.3-40.el7 ################################# [ 44%]8:yum-metadata-parser-1.1.4-10.el7 ################################# [ 50%]9:yum-plugin-fastestmirror-1.1.31-5################################# [ 56%]10:yum-3.4.3-163.el7.centos ################################# [ 63%]11:yum-utils-1.1.31-52.el7 ################################# [ 69%]12:yum-plugin-aliases-1.1.31-52.el7 ################################# [ 75%]13:yum-plugin-protectbase-1.1.31-52.################################# [ 81%]14:python-devel-2.7.5-86.el7 ################################# [ 88%]15:python-setuptools-0.9.8-7.el7 ################################# [ 94%]16:python-libs-2.7.5-86.el7 ################################# [100%][root@localhost ]# yum已加载插件:aliases, fastestmirror, protectbase
4、验证是否安装成功
[root@localhost python1]# yum version已加载插件:aliases, fastestmirror, protectbase已安装: 7/x86_64 309:f750cd064e188ca0a37ecf9fae017451dd5d422b组已安装: yum 14:b8f9fd2f14cdc83d4bc930c6ae9f87e7cd156e51version[root@localhost python1]# python -VPython 2.7.5[root@localhost python1]#
查看全文
99%的人还看了
相似问题
- 【下载器】NDM和IDM介绍(含安装包和教程)
- Centos系统上安装包(软件)时常用的命令wget、rpm、yum分别是什么意思和作用?
- Typora(morkdown编辑器)的安装包和安装教程
- MacOS Mojave(苹果14系统) v10.14.6中文离线安装包
- 会声会影2023永久稳定绿色汉化中文版安装包下载
- MATLAB R2023b安装包下载链接及软件安装教程
- Git简洁安装方式和使用方式【附安装包资源,Git基础操作,如拉取项目、上传代码、拉取代码】
- ASUS华硕ZenBook灵耀X逍遥UXF3000E_UX363EA原装出厂预装Win11系统工厂模式安装包
- macOS使用官方安装包安装python
- 记一次linux下pip安装包时出错及奇怪的解决过程
猜你感兴趣
版权申明
本文"Centos7 Python环境和yum修复":http://eshow365.cn/6-42059-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!
- 上一篇: STM32_3(GPIO)
- 下一篇: 1999-2021年地级市城镇居民人均消费性支出数据