Ubuntu 18.04から20.04へのアップグレードでPythonが壊れる

Ubuntu 18.04から20.04へのアップグレードでPythonが壊れる

今日、サーバーを 18.04 LTS から 20.04 LTS にアップデートしました。残念ながら、2 つの問題が発生しています。

1. apt-get update && upgrade が機能しません。

   マシンは「Depends」エラーの長いリストを返します。以下を参照してください。

The following packages have unmet dependencies:
     debconf-i18n : Depends: debconf (= 1.5.73) but 1.5.66ubuntu1 is installed
     dirmngr : Depends: init-system-helpers (>= 1.52) but 1.51 is installed
     gir1.2-gtk-3.0 : Depends: gir1.2-gdkpixbuf-2.0 (>= 2.40.0) but 2.36.11-2 is installed
                      Depends: gir1.2-pango-1.0 (>= 1.41.0) but 1.40.14-1ubuntu0.1 is installed
                      Depends: libgtk-3-0 (>= 3.24.7) but 3.22.30-1ubuntu4 is installed
     gnupg : Depends: gpgv (>= 2.2.19-3ubuntu2.2)
     gpg-agent : Depends: init-system-helpers (>= 1.52) but 1.51 is installed
     mailutils : Depends: guile-2.2-libs but it is not installed
                 Depends: libmailutils6 but it is not installed
                 Depends: libncurses6 (>= 6) but it is not installed
     python3 : PreDepends: python3-minimal (= 3.6.7-1~18.04) but 3.8.2-0ubuntu2 is installed
               Depends: libpython3-stdlib (= 3.6.7-1~18.04) but 3.8.2-0ubuntu2 is installed
     python3-apt : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-cairo : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-cffi-backend : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-cheetah : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-crypto : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-dbus : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-dev : Depends: python3 (= 3.8.2-0ubuntu2) but 3.6.7-1~18.04 is installed
                   Depends: libpython3-dev (= 3.8.2-0ubuntu2) but 3.6.7-1~18.04 is installed
                   Depends: python3.8-dev (>= 3.8.2-1~) but it is not installed
     python3-distutils : Depends: python3:any (>= 3.8.2-0~)
     python3-geoip : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-gi : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
                  Depends: libgirepository-1.0-1 (>= 1.62.0-4~) but 1.56.1-1 is installed
     python3-gi-cairo : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-icu : Depends: libicu66 (>= 66.1~rc-1~) but it is not installed
                   Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-lib2to3 : Depends: python3:any (>= 3.8.2-0~)
     python3-libtorrent : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
                          Depends: libtorrent-rasterbar10 (= 1.2.16~daily10769+e0dd73971-202206291010~ubuntu20.04.1) but 1.2.16~daily10769+e0dd73971-202206291010~ubuntu18.04.1 is installed
     python3-markupsafe : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-netifaces : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-newt : Depends: libnewt0.52 (= 0.52.21-4ubuntu2) but 0.52.20-1ubuntu1 is installed
                    Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-pam : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-pil : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
                   Depends: libfreetype6 (>= 2.9.1) but 2.8.1-2ubuntu2.2 is installed
                   Depends: libimagequant0 (>= 2.11.10) but it is not installed
                   Depends: libwebpmux3 (>= 0.6.1-2ubuntu0.20.04.1) but 0.6.1-2ubuntu0.18.04.1 is installed
     python3-rencode : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-sabyenc : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-setproctitle : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-simplejson : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-systemd : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-twisted-bin : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-ujson : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-yaml : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-zope.hookable : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
     python3-zope.interface : Depends: python3 (>= 3.8~) but 3.6.7-1~18.04 is installed
    E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

2. Python が動作しません。

これまでに、次のことを試しました。

1. apt --fix-broken install.

   これらのエラーは次のように表示されます。

`Exception: python3.8 -c 'import imp; print(imp.get_tag())' failed with status code 139
dpkg: error processing package python3-minimal (--configure):
 installed python3-minimal package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 python3-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)`

2. Python をアンインストールして修正しようとしました。

   取得できるのは上記の依存関係リストだけです。python --version で Python 3.6.9 がインストールされていることも確認しました。更新できません。

3. aptitude を使用しましたが、Python パッケージを修復できません。

どのようなご助力やご提案でもいただければ幸いです。

関連情報