yumが壊れたので修理する

yumを実行しようとしたら以下のエラーを吐いて終了する事態となってしまいました。

    File "/bin/yum", line 30

    except KeyboardInterrupt, e:

 調べてみたらyumスクリプトがpython2で動いているため前回記事にしたpython3に上げたことで動かなくなってしまったようです。そこで動くようになおしてみました。

まずはpythonスクリプトをエディタで開きます。私はemacsを使うのでemacsで開きます。

  emacs /usr/bin/yum

 開いたら1行目の文言を以前入っていた2.7に変えます。

    #!/usr/bin/python2.7

環境によっては入っているバージョンが違うので以下のコマンドでバージョンを確認しておいてください。

    cd /usr/bin/

    ll | grep python

修正したら動くか確認。yum updateで確認します。

しかしまた別の問題が・・・。

読み込んだプラグイン:fastestmirror, langpacks

Repository google-chrome is listed more than once in the configuration

base                                                               | 3.6 kB  00:00:00

code                                                               | 2.9 kB  00:00:00

docker-ce-stable                                                   | 2.9 kB  00:00:00

epel/x86_64/metalink                                               | 7.9 kB  00:00:00

epel                                                               | 4.7 kB  00:00:00

extras                                                             | 3.4 kB  00:00:00

google-chrome                                                      |  951 B  00:00:00

ius                                                                | 2.3 kB  00:00:00

ftp://mirrors.tummy.com/pub/rpm.livna.org/repo/7/x86_64/repodata/repomd.xml: [Errno 14] FTP Error 550 - Server denied you to change to the given directory

他のミラーを試します。

livna                                                              |  951 B  00:00:00

nux-dextop                                                         | 2.9 kB  00:00:00

updates                                                            | 3.4 kB  00:00:00

virtualbox/7/x86_64/signature                                      |  181 B  00:00:00

virtualbox/7/x86_64/signature                                      | 1.1 kB  00:00:00 !!!

  File "/usr/libexec/urlgrabber-ext-down", line 28

    except OSError, e:

                  ^

SyntaxError: invalid syntax

  File "/usr/libexec/urlgrabber-ext-down", line 28

    except OSError, e:

                  ^

SyntaxError: invalid syntax

  File "/usr/libexec/urlgrabber-ext-down", line 28

    except OSError, e:

                  ^

SyntaxError: invalid syntax

  File "/usr/libexec/urlgrabber-ext-down", line 28

    except OSError, e:

                  ^

SyntaxError: invalid syntax

  File "/usr/libexec/urlgrabber-ext-down", line 28

    except OSError, e:

                  ^

SyntaxError: invalid syntax





ユーザーのキャンセルで終了しています



これは別のpythonスクリプトが問題起こしているようなので問題のPythonを修正します。

以下のファイルを開きます。

    emacs /usr/libexec/urlgrabber-ext-down

 開いたら先ほど同様1行目の文言を以前入っていた2.7に変えます。

    #!/usr/bin/python2.7

修正後、もう一回yum updateを実行。今度は動いたようです。

pythonのバージョンアップには気をつけましょう。

 

読み込んだプラグイン:fastestmirror, langpacks

Repository google-chrome is listed more than once in the configuration

Loading mirror speeds from cached hostfile

 * base: ftp.iij.ad.jp

 * epel: kartolo.sby.datautama.net.id

 * extras: ftp.iij.ad.jp

 * ius: mirrors.kernel.org

 * livna: wftp.tu-chemnitz.de

 * nux-dextop: li.nux.ro

 * updates: ftp.iij.ad.jp

依存性の解決をしています

・・・