python をupdateするとyumが動かなくなった場合の対処
awsでpythonを2.7へアップデートした後、 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.5 (default, May 5 2015, 16:19:52) [GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] If you cannot solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/Faq
/usr/bin/yumを見る
#!/usr/bin/python2.7 ・・・・・
pythonのバージョンを見る
# ll /usr/bin/python python python2 python26 python2.6 python27 python2.7
/usr/bin/yumの編集
#!/usr/bin/python2.6 ・・・・・
以上で完了