centos7 中yum不能用了

使用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.12 (default, Oct 27 2020, 16:11:03)
[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:
http://yum.baseurl.org/wiki/Faq

1、解决办法 查看 查看yum 脚本
vim /usr/bin/yum
centos7 中yum不能用了
当前yum 使用 的python 脚本
替换脚本
查看当前系统中有哪些python可供选择

centos7 中yum不能用了
还不行,只能重装yum 啦

2、重装yum

参看这位大佬写的就可以

https://blog.csdn.net/qq_36653942/article/details/80712088

猜你喜欢

转载自blog.51cto.com/15084467/2600471