从18.04升级到ubuntu 19.10后,运行命令sudo apt update时模块未找到错误

最近从ubuntu版本18.04升级到19.10,现在我的APT已停止正常运行,并且不会让我执行sudo apt更新。最重要的是,当我尝试使用导入json的python3运行简单的python脚本时,出现模块未找到错误。我的基于GUI的更新管理器也已停止工作。 我尝试过的东西包括

  • sudo apt remove python3-apt:试图删除python3,但无法收到我收到的消息是
  ~$ sudo apt remove python3-apt
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    You might want to run 'apt --fix-broken install' to correct these.
    The following packages have unmet dependencies:
     apturl-common : Depends: python3-apt but it is not going to be installed
     gir1.2-gtk-3.0 : Depends: gir1.2-pango-1.0 (>= 1.41.0) but 1.40.14-1ubuntu0.1 is to be installed
                  Depends: libgtk-3-0 (>= 3.24.7) but 3.22.30-1ubuntu4 is to be installed
     gnupg : Depends: gpgv (>= 2.2.12-1ubuntu3)
     gnupg-utils : Depends: libreadline8 (>= 6.0) but it is not going to be installed
     gpg : Depends: libreadline8 (>= 6.0) but it is not going to be installed
     gpgconf : Depends: libreadline8 (>= 6.0) but it is not going to be installed
     gpgsm : Depends: libreadline8 (>= 6.0) but it is not going to be installed
     hplip : Depends: hplip-data (= 3.19.6+dfsg0-1ubuntu1) but 3.17.10+repack0-5 is to be installed
         Depends: libhpmud0 (= 3.19.6+dfsg0-1ubuntu1) but 3.17.10+repack0-5 is to be installed
         Depends: printer-driver-hpcups (= 3.19.6+dfsg0-1ubuntu1) but 3.17.10+repack0-5 is to be installed
         Depends: libpython3.7 (>= 3.7.0) but it is not going to be installed
     language-selector-common : Depends: python3-apt (>= 0.7.12.0) but it is not going to be installed
     language-selector-gnome : Depends: python3-apt but it is not going to be installed
     python3 : Depends: python3.7 (>= 3.7.5~rc1-1~) but it is not going to be installed
           Depends: libpython3-stdlib (= 3.7.5-1) but 3.6.7-1~18.04 is to be installed
     python3-apport : Depends: python3-apt (>= 0.7.9) but it is not going to be installed
     python3-aptdaemon : Depends: python3-apt (>= 0.8.5~ubuntu1) but it is not going to be installed
     python3-commandnotfound : Depends: python3-apt but it is not going to be installed
     python3-dev : Depends: libpython3-dev (= 3.7.5-1) but 3.6.7-1~18.04 is to be installed
               Depends: python3.7-dev (>= 3.7.5~rc1-1~) but it is not going to be installed
               Depends: python3-distutils (>= 3.7.5~rc1-1~) but 3.6.9-1~18.04 is to be installed
     python3-distupgrade : Depends: python3-apt (>= 0.8.5~) but it is not going to be installed
     python3-pil : Depends: libfreetype6 (>= 2.9.1) but 2.8.1-2ubuntu2 is to be installed
               Depends: libimagequant0 (>= 2.11.10) but it is not going to be installed
     python3-protobuf : Depends: libprotobuf17 but it is not going to be installed
     python3-software-properties : Depends: python3-apt (>= 0.6.20ubuntu16) but it is not going to be installed
     python3-uno : Depends: libreoffice-core (= 1:6.3.5-0ubuntu0.19.10.1) but 1:6.0.7-0ubuntu0.18.04.10 is to be installed
               Depends: python3.7 but it is not going to be installed
               Depends: libpython3.7 (>= 3.7.0) but it is not going to be installed
     python3-update-manager : Depends: python3-apt (>= 0.8.5~) but it is not going to be installed
     rhythmbox-plugins : Depends: librhythmbox-core10 (= 3.4.3-2ubuntu1) but 3.4.2-4ubuntu1 is to be installed
                     Depends: python3.7 but it is not going to be installed
                     Depends: rhythmbox (= 3.4.3-2ubuntu1) but 3.4.2-4ubuntu1 is to be installed
                     Depends: gir1.2-rb-3.0 (= 3.4.3-2ubuntu1) but 3.4.2-4ubuntu1 is to be installed
     ubuntu-drivers-common : Depends: python3-apt but it is not going to be installed
     ubuntu-system-service : Depends: python3-apt but it is not going to be installed
     unattended-upgrades : Depends: python3-apt but it is not going to be installed
     update-notifier-common : Depends: python3-apt but it is not going to be installed
    E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

**当我运行sudo apt update时,出现以下错误:**

:~$ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu eoan InRelease
Get:2 http://archive.ubuntu.com/ubuntu eoan-updates InRelease [97.5 kB]
Get:3 http://archive.ubuntu.com/ubuntu eoan-backports InRelease [88.8 kB]
Get:4 http://archive.ubuntu.com/ubuntu eoan-security InRelease [97.5 kB]
Fetched 284 kB in 2s (136 kB/s)    
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 8, in <module>
    from CommandNotFound.db.creator import DbCreator
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 4, in <module>
    import json
ModuleNotFoundError: No module named 'json'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 15, in <module>
    import xml.dom, xml.dom.minidom
ModuleNotFoundError: No module named 'xml'

Original exception was:
Traceback (most recent call last):
  File "/usr/lib/cnf-update-db", line 8, in <module>
    from CommandNotFound.db.creator import DbCreator
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/creator.py", line 4, in <module>
    import json
ModuleNotFoundError: No module named 'json'
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code
评论