sudo apt-get сломался после обновления sudo apt-get

В настоящее время я работаю на Ubuntu 16.04 и столкнулся с некоторыми проблемами:

Я ввел 'sudo apt-get update', затем 'sudo apt-get -Y upgrade', чтобы обновить пакеты и сломал свой apt-get. Теперь, когда я пытаюсь установить с помощью 'sudo apt-get install', я получаю сообщения об ошибках 'chardet'

Я также получаю ошибки при вводе 'python --version'

Traceback (most recent call last):
    File "/usr/lib/python3.6/dbm/gnu.py", line 4, in <module>
        from _gdbm import *
ModuleNotFoundError: No module named '_gdbm'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 7, in <module>
    import dbm.gnu as gdbm
  File "/usr/lib/python3.6/dbm/gnu.py", line 6, in <module>
    raise ImportError(str(msg) + ', please install the python3-gdbm package')
ImportError: No module named '_gdbm', please install the python3-gdbm package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 27, in <module>
    from CommandNotFound.util import crash_guard
  File "/usr/lib/python3/dist-packages/CommandNotFound/__init__.py", line 3, in <module>
    from CommandNotFound.CommandNotFound import CommandNotFound
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 9, in <module>
    import gdbm
ModuleNotFoundError: No module named 'gdbm'

Поэтому я попытался установить gdbm с помощью "sudo apt-get install python3-gdbm" и получил следующее сообщение об ошибке:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-gdbm is already the newest version (3.5.1-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up update-notifier-common (3.168.9) ...
Traceback (most recent call last):
  File "/usr/lib/update-notifier/package-data-downloader", line 24, in <module>
    import debian.deb822
  File "/usr/lib/python3/dist-packages/debian/deb822.py", line 38, in <module>
    import chardet
ModuleNotFoundError: No module named 'chardet'
dpkg: error processing package update-notifier-common (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of update-notifier:
 update-notifier depends on update-notifier-common (= 3.168.9); however:
  Package update-notifier-common is not configured yet.

dpkg: error processing package update-notifier (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-desktop:
 ubuntu-desktop depends on update-notifier; however:
  Package update-notifier is not configured yet.

dpkg: error processing package ubuntu-desktop (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-server:
 ubuntu-server depends on update-notifier-common; however:
  Package update-notifier-common is not configured yet.

dpkg: error processing package ubuntu-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                    No apport report written because MaxReports is reached already
                                  Errors were encountered while processing:
 update-notifier-common
 update-notifier
 ubuntu-desktop
 ubuntu-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Наконец, я запустил sudo apt-get install python3-chardet, чтобы попытаться загрузить chardet, но я получил эту ошибку:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-chardet is already the newest version (2.3.0-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up update-notifier-common (3.168.9) ...
Traceback (most recent call last):
  File "/usr/lib/update-notifier/package-data-downloader", line 24, in <module>
    import debian.deb822
  File "/usr/lib/python3/dist-packages/debian/deb822.py", line 38, in <module>
    import chardet
ModuleNotFoundError: No module named 'chardet'
dpkg: error processing package update-notifier-common (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of update-notifier:
 update-notifier depends on update-notifier-common (= 3.168.9); however:
  Package update-notifier-common is not configured yet.

dpkg: error processing package update-notifier (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-desktop:
 ubuntu-desktop depends on update-notifier; however:
  Package update-notifier is not configured yet.

dpkg: error processing package ubuntu-desktop (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-server:
 ubuntu-server depends on update-notifier-common; however:
  Package update-notifier-common is not configured yet.

dpkg: error processing package ubuntu-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                    No apport report written because MaxReports is reached already
                                  Errors were encountered while processing:
 update-notifier-common
 update-notifier
 ubuntu-desktop
 ubuntu-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Как я могу исправить мою систему apt-get?

0 ответов

Другие вопросы по тегам