服务器Centos(linux)上python2.6.6升级到2.7.6,yum不能用了

服务器Centos(linux)上python2.6.6升级到2.7.6,yum不能用了的解决办法:

  vim /usr/bin/yum 

编辑第一行

  #!/usr/bin/python
  import sys
  try:

改成如下(原python版本是2.6)

  #!/usr/bin/python2.6
  import sys
  try:

这些yum正常了。

~ yum --version
  3.2.29
    Installed: rpm-4.8.0-47.el6.x86_64 at 2015-10-19 07:20
    Built    : CentOS BuildSystem  at 2015-07-24 11:28
    Committed: Lubos Kardos  at 2015-06-15

    Installed: yum-3.2.29-69.el6.centos.noarch at 2015-10-19 07:20
    Built    : CentOS BuildSystem  at 2015-07-24 10:28
    Committed: Johnny Hughes  at 2015-07-22

    Installed: yum-plugin-fastestmirror-1.1.30-30.el6.noarch at 2014-12-31 16:13
    Built    : CentOS BuildSystem  at 2014-10-15 07:16
    Committed: Valentina Mukhamedzhanova  at 2014-08-11

你可能感兴趣的:(服务器Centos(linux)上python2.6.6升级到2.7.6,yum不能用了)