yum update でpython3 に関する依存関係のエラー発生

AmazonLinux_CentOS,AWS,OperatingSystem

症状

  • Amazon Linux 2 にて、sudo yum update –security コマンドを実行した際に、python3 に関する dependency resolution のエラーとなりました。以下に記載します。
  • 原因は、amzn2-core のリポジトリ (Amazon Linux 2 core repository) と epel のリポジトリ (Extra Packages for Enterprise Linux 7)から提供されるpython3 のパッケージとの間で依存関係の解決に失敗しました。
  • よくある依存関係のエラーとなりますが、要因となるリポジトリを無効にして、yum update する方法が覚えられないので、記事にします。

 

--> Finished Dependency Resolution
Error: Package: python36-simplejson-3.11.1-1.el7.x86_64 (epel)
           Requires: python(abi) = 3.6
           Removing: python-2.7.16-3.amzn2.0.1.x86_64 (@amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Updated By: python-2.7.18-1.amzn2.0.9.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.5-58.amzn2.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.14-58.amzn2.0.2.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.14-58.amzn2.0.3.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.14-58.amzn2.0.4.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.16-1.amzn2.0.1.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.16-2.amzn2.0.1.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.16-4.amzn2.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.16-5.amzn2.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.18-1.amzn2.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.18-1.amzn2.0.1.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.18-1.amzn2.0.2.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.18-1.amzn2.0.3.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.18-1.amzn2.0.4.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.18-1.amzn2.0.5.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.18-1.amzn2.0.6.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.18-1.amzn2.0.7.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python-2.7.18-1.amzn2.0.8.x86_64 (amzn2-core)
               python(abi) = 2.7
               python(abi) = 2.7
           Available: python3-3.7.0-0.12.b2.amzn2.0.2.x86_64 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.0-0.16.b3.amzn2.0.1.x86_64 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.0-0.20.rc1.amzn2.0.1.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.0-0.20.rc1.amzn2.0.2.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.1-9.amzn2.0.1.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.2-4.amzn2.0.1.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.3-1.amzn2.0.1.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.3-1.amzn2.0.2.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.4-1.amzn2.0.1.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.4-1.amzn2.0.2.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.4-1.amzn2.0.3.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.4-1.amzn2.0.4.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.6-1.amzn2.0.1.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.8-1.amzn2.0.1.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.9-1.amzn2.0.1.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.9-1.amzn2.0.2.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.9-1.amzn2.0.3.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.10-1.amzn2.0.1.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.15-1.amzn2.0.1.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.15-1.amzn2.0.2.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.16-1.amzn2.0.1.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.16-1.amzn2.0.2.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.16-1.amzn2.0.4.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.16-1.amzn2.0.5.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.16-1.amzn2.0.6.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.16-1.amzn2.0.7.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python3-3.7.16-1.amzn2.0.8.i686 (amzn2-core)
               python(abi) = 3.7
               python(abi) = 3.7
           Available: python34-3.4.10-8.el7.x86_64 (epel)
               python(abi) = 3.4
Error: Package: python36-simplejson-3.11.1-1.el7.x86_64 (epel)
           Requires: libpython3.6m.so.1.0()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

 

対処方法

  • 一時的に、epel リポジトリを無効にしてインストールを行います。repoファイルは編集しないため、作業後は特に戻しは必要ありません。
  • 先ず、"repo id" を確認するため、yum repolist all を実行します。次に、repo id を指定、要因となったリポジトリを一時的に無効化して、パッケージをインストールします。
$ yum repolist all
← "repo id" を確認する

$ yum update --security --disablerepo=epel
← 特定したrepo idを指定、無効化してパッケージをインストールする