web-dev-qa-db-ja.com

16.10から17.04へのアップグレードに失敗しましたが、APTはエラーをスローします

アップグレードに失敗した後、トップバーメニューに新しいアイコンが表示されます

Error : BrokonCount >0

そして、パッケージをアップグレードまたはインストールしたいとき、私はこの問題を抱えています

$ Sudo apt-get upgrade
        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:
         python3 : PreDepends: python3-minimal (= 3.5.1-4) but 3.5.3-1 is installed
         python3-dev : Depends: python3 (= 3.5.3-1) but 3.5.1-4 is installed
                       Depends: libpython3-dev (= 3.5.3-1) but 3.5.1-4 is installed
        E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

そして、このコマンドを試したとき 'apt --fix-broken install'次のメッセージが表示されます:

$ Sudo apt --fix-broken install 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libidl-2-0 libjson-c3:i386 libkeybinder0 liborbit2 libudev1:i386 libvte-common libvte9 libwings3 libwraster5 libwutil5 linux-headers-4.8.0-34
  linux-headers-4.8.0-34-generic linux-headers-4.8.0-37 linux-headers-4.8.0-37-generic linux-headers-4.8.0-38 linux-headers-4.8.0-38-generic
  linux-headers-4.8.0-39 linux-headers-4.8.0-39-generic linux-headers-4.8.0-41 linux-headers-4.8.0-41-generic linux-headers-4.8.0-44
  linux-headers-4.8.0-44-generic linux-image-4.8.0-34-generic linux-image-4.8.0-37-generic linux-image-4.8.0-38-generic linux-image-4.8.0-39-generic
  linux-image-4.8.0-41-generic linux-image-4.8.0-44-generic linux-image-extra-4.8.0-34-generic linux-image-extra-4.8.0-37-generic
  linux-image-extra-4.8.0-38-generic linux-image-extra-4.8.0-39-generic linux-image-extra-4.8.0-41-generic linux-image-extra-4.8.0-44-generic
  python-appindicator python-apport python-gconf python-gnome2 python-keybinder python-notify python-piston-mini-client python-problem-report
  python-pyorbit python-vte ubuntu-core-launcher
Use 'Sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libpython3-dev libpython3-stdlib python3
Suggested packages:
  python3-doc python3-tk python3-venv
The following packages will be upgraded:
  libpython3-dev libpython3-stdlib python3
3 upgraded, 0 newly installed, 0 to remove and 1484 not upgraded.
5 not fully installed or removed.
Need to get 0 B/22.5 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python3.5-minimal (3.5.3-1) ...
Traceback (most recent call last):
  File "/usr/lib/python3.5/py_compile.py", line 6, in <module>
    import importlib._bootstrap_external
  File "/usr/lib/python3.5/importlib/__init__.py", line 57, in <module>
    import types
  File "/usr/lib/python3.5/types.py", line 166, in <module>
    import functools as _functools
  File "/usr/lib/python3.5/functools.py", line 23, in <module>
    from weakref import WeakKeyDictionary
  File "/usr/lib/python3.5/weakref.py", line 12, in <module>
    from _weakref import (
ImportError: cannot import name '_remove_dead_weakref'
dpkg: error processing package python3.5-minimal (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python3-minimal:
 python3-minimal depends on python3.5-minimal (>= 3.5.3-1~); however:
  Package python3.5-minimal is not configured yet.

dpkg: error processing package python3-minimal (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 python3.5-minimal
 python3-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)

どうすればこの問題を解決できますか?

2
Nebil Aydi

以下は このリンク に基づいており、コメント投稿者が私のために行った手順です。

  1. Sudo nautilusを実行します(ターミナルで)
  2. /usr/local/binに移動し、「python3」が含まれているファイル/ショートカット/フォルダーを削除します
  3. /usr/local/libに移動し、同じことを行います
  4. 新しいターミナルを開きます(例: Ctrl+Alt+T
  5. 実行

    Sudo apt --fix-broken install &&
         Sudo apt -y update &&
         Sudo apt -y upgrade &&
         Sudo apt -y dist-upgrade &&
         Sudo apt -f install &&
         Sudo apt -y autoremove &&
         Sudo apt autoclean &&
         Sudo apt clean
    

    (必要に応じて、より少ない行に組み合わせることができます。)

  6. リブート

  7. 5番をもう一度実行します
1
Nemna