6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

/usr/bin/pythonのシンボリックリンクを変更後、yumがエラー

Posted at

thinkpadにCentOS入れて色々勉強中。

##環境
CentOS 7
python 2.7
Python 3.6

##やったこと
python2使わないしいちいちpython3と打つのが面倒だと思った為、
以下にてシンボリックリンクを作成。

rm /usr/bin/python
ln -s /usr/bin/python3.6 /usr/bin/python

その後yum installとかyum searchを使おうと思っても以下のエラーが出る。

  File "/bin/yum", line 30
    except KeyboardInterrupt, e:
            ^
SyntaxError: invalid syntax

/usr/bin/yumの中身見たら当然でした。1行目で該当のシンボリックリンクを
使ってました。

`#!/usr/bin/python

以下にてyumの1行目を修正。

vi /usr/bin/yum
`#!/usr/bin/python2.7

問題なく動作するのでたぶんOK

6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?