My first time here to ask question.
Hope my question could help more friends after solved.
Base:
System Version: CentOS 7.2 64 bit
Problem:
Wrongly remove python
that comes with the system. And yum
could not be use.
Solution:
1. At this time, the warning message is: screenshot of warning message.
And I focus the question https://stackoverflow.com/questions/18632016/yum-no-module-named-yum at the 1st answer, but it doesn't work.
And I try another way, why not reinstall yum... From then on, cause of this command
rpm -qa | grep yum | xargs rpm -e --nodeps
I was trapped in the "dependencies circle".
2. I followed the 2nd answer in https://stackoverflow.com/questions/18632016/yum-no-module-named-yum. Download all packages dependent from http://mirrors.163.com/centos/7/os/x86_64/Packages/.
Packages list: screenshot of packages installed list.
After I enter this command
rpm -Uvh --replacepkgs *.rpm
All packages installed. And it shows me the problem I didn't find in stackoverflow...
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
/usr/lib64/python2.7/site-packages/rpm/_rpm.so: undefined symbol: rpmpkgVerifySigs
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, Aug 4 2017, 00:39:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
Attempt
Try many times with reinstall yum, rpm and python.. And I know the best way maybe reinstall the system but solving the problem without reinstall is more appealing to friends and me.
Thank you, my friends.