Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3152336
  • 博文数量: 443
  • 博客积分: 11301
  • 博客等级: 上将
  • 技术积分: 5678
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-08 12:30
个人简介

欢迎加入IT云增值在线QQ交流群:342584734

文章分类

全部博文(443)

文章存档

2022年(1)

2021年(1)

2015年(2)

2014年(1)

2013年(1)

2012年(4)

2011年(19)

2010年(32)

2009年(2)

2008年(4)

2007年(31)

2006年(301)

2005年(42)

2004年(2)

分类: LINUX

2021-09-01 17:17:42

在给客户配置一台CentOS 7.8系统的本地yum源后,执行
# yum clean all && yum makecache
# yum list

均报错:
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

赶紧whereis python,没有路径,rpm -qa| grep python也没有输出,怀疑客户自己删掉了python。

进入相同版本的iso挂载pkg目录,执行rpm -ivh *python*提示报错,无法正常安装,有很多依赖关系。

只能选择忽略依赖安装,执行:
# rpm -ivh  *python* --nodeps
顺利安装了相关python包,再执行yum list看看,结果又报错了:
# yum list
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.5 (default, Apr  2 2020, 13:16:51) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

If you cannot solve this problem yourself, please go to 
the yum faq at:
 

从报错中可以看出是python版本和yum不兼容,感觉没道理呀,相同的源怎么会这样?
只好重新安装yum试试:
# rpm -Uvh --replacepkgs *yum* --nodeps
再次执行yum list可以看到本地yum源,测试下软件包的安装:
# yum -y install ntp
也能顺利安装。


阅读(1712) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~