--> -->

skimemo


skimemo - 日記/2014-07-05/Pythonをソースから入れたらyumの整合性が壊れたので修復 の変更点


#blog2navi()
*Pythonをソースから入れたらyumの整合性が壊れたので修復 [#zd02cc92]

調子に乗ってPython2.7をビルドしたのは良かったのですが、yumの管理外でpythonが2.7になってしまったため、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.8 (default, Jul  5 2014, 14:19:54)
 [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
 
 If you cannot solve this problem yourself, please go to
 the yum faq at:
   http://yum.baseurl.org/wiki/Faq

しかも、あろう事か古いpythonの実行ファイルは削除してしまいました。~
~
仕方が無いので、rpmで再インストール。~
 wget http://mirror.centos.org/centos/6.5/updates/x86_64/Packages/python-2.6.6-52.el6.x86_64.rpm
普通にやっても「既に入っている」と怒られます。
 $ sudo rpm -Uhv python-2.6.6-52.el6.x86_64.rpm
 Preparing...                ########################################### [100%]
         package python-2.6.6-52.el6.x86_64 is already installed

そこで、強制インストール。
 sudo rpm -i --force python-2.6.6-52.el6.x86_64.rpm
これで入りました。
 $/usr/bin/python
 Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
 [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>>
あとは、再度python2.7に差し替えて、yumのpythonの指定を2.6にします。
 sudo mv /usr/bin/python /usr/bin/python2.6
 sudo ln -s /usr/local/bin/python /usr/bin/python
 sudo vi /usr/bin/yum
~
 #!/usr/bin/python2.6
完成。
 $ yum
 Loaded plugins: fastestmirror, security
 You need to give some command
 Usage: yum [options] COMMAND
 
 List of Commands:
     :
     :


RIGHT:Category: [[[Linux>日記/Category/Linux]]] - 17:39:06
----
RIGHT:&blog2trackback();
- KPjeSceORfEh -- [[Czxbmnsy]] &new{2016-02-22 (月) 13:54:56};

#comment(above)
#blog2navi()