In the environment of CentOS (6.9 this time), I often use yum, but suddenly I can't use it. Is it because of the python version? → I don't understand anymore.
I went back and forth to the reference sites, and finally it started working.
File "/usr/bin/yum", line 29, in
# yum update
Loaded plugin:fastestmirror
Loading mirror speeds from cached hostfile
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in <module>
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 370, in user_main
errcode = main(args)
...
Fixed yum config file
text:/etc/yum/pluginconf.d/fastestmirror.conf
[main]
enabled=0
http://blog.dksg.jp/2017/04/yum-update.html
No module named yum Second error The version doesn't match
↓ is a similar log (different from when it actually occurred)
# yum update
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 (r265:79063, Feb 28 2011, 21:55:45)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.duke.edu/YumFaq
Specifying python to run yum
/usr/bin/before yum correction
#!/usr/bin/python
import sys
try:
import yum
...
/usr/bin/After yum correction
#!/usr/bin/python2.6
import sys
try:
import yum
...
http://d.hatena.ne.jp/ike-dai/20110713/1310552674
Recommended Posts