
私は Ubuntu 14.04 を使用していますが、なぜか画面に次のような赤いシンボルが表示されます。
これを使用してアップグレードしようとすると、sudo apt-get upgrade
エラーが発生します:
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
click : Depends: python3-click-package (= 0.4.45.1+16.10.20160916-0~619~ubuntu14.04.1)
E: Unmet dependencies. Try using -f.
Enter するとsudo apt-get -f install
別のエラーが発生します:
$ sudo apt-get -f 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:
at bzr bzr-builddeb click-dev click-doc dctrl-tools debian-archive-keyring
debootstrap devscripts distro-info distro-info-data dput ebtables fcitx-libs
fcitx-libs-gclient freetds-common gdb-multiarch libaio1
libboost-filesystem1.54.0 libboost-program-options1.54.0
libboost-regex1.54.0 libboost-thread1.54.0 libcommon-sense-perl
libdistro-info-perl libdrm-intel1:i386 libdrm-nouveau2:i386
libdrm-radeon1:i386 libelf1:i386 libexpat1:i386 libexporter-lite-perl
libffi6:i386 libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 libglapi-mesa:i386
libio-stringy-perl libjs-sphinxdoc libjson-perl libjson-xs-perl
libllvm3.4:i386 liblxc1 libodbc1 libparse-debcontrol-perl libpciaccess0:i386
libpq5 librados2 librbd1 libstdc++6:i386 libsybdb5 libtie-ixhash-perl
libtxc-dxtn-s2tc0:i386 libx11-xcb1:i386 libxcb-dri2-0:i386
libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386
libxcb-xinerama0 libxdamage1:i386 libxdelta2 libxfixes3:i386
libxshmfence1:i386 libxxf86vm1:i386 lxc-common lxcfs lxd lxd-client pbuilder
pbzip2 pristine-tar pybootchartgui python-bzrlib python-configobj
python-debianbts python-distro-info python-dns python-fpconst python-gpgme
python-keyring python-launchpadlib python-lazr.restfulclient python-lazr.uri
python-lzma python-oauth python-reportbug python-secretstorage
python-simplejson python-soappy python-wadllib qemu-utils quilt reportbug
schroot schroot-common ubuntu-dev-tools ubuntu-emulator
ubuntu-emulator-runtime:i386 ubuntu-sdk-tools uidmap xdelta
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
click
Suggested packages:
ubuntu-app-launch-tools upstart-app-launch-tools
Recommended packages:
click-apparmor
The following packages will be upgraded:
click
1 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
13 not fully installed or removed.
Need to get 0 B/14.8 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 297452 files and directories currently installed.)
Preparing to unpack .../click_0.4.46+17.10.20170607.3-0~622~ubuntu14.04.1_amd64.deb ...
Failed to issue method call: Unit click-system-hooks.service not loaded.
dpkg: warning: subprocess old pre-removal script returned error exit status 5
dpkg: trying script from the new package instead ...
Failed to issue method call: Unit click-system-hooks.service not loaded.
dpkg: error processing archive /var/cache/apt/archives/click_0.4.46+17.10.20170607.3-0~622~ubuntu14.04.1_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 5
Failed to issue method call: Unit click-system-hooks.service failed to load: No such file or directory. See system logs and 'systemctl status click-system-hooks.service' for details.
Errors were encountered while processing:
/var/cache/apt/archives/click_0.4.46+17.10.20170607.3-0~622~ubuntu14.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
私もインストールできないpython3-click-package
$ sudo apt-get install python3-click-package
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-click-package is already the newest version.
python3-click-package set to manually installed.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
click : Depends: python3-click-package (= 0.4.45.1+16.10.20160916-0~619~ubuntu14.04.1)
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Google で見つかった各コマンドをインストールしようとしましたが、残念ながら :(
このエラーを解決する方法を教えてください
答え1
誤って、インストールしたバージョンと互換性のないライブラリを含むパッケージを Ubuntu 14.04 にインストールしようとしました。問題のあるパッケージを削除し、Ubuntu バージョンに適したパッケージをインストールする必要があります。
エラーは、click
パッケージpython3-click-package
に少なくとも0.4.45.1+16.10.20160916-0~619~ubuntu14.04.1python3-click-package
Ubuntu 16.04のバージョンは0.4.43+16.04.20170613-0ubuntu1。これは0.4.45失敗したclick
インストールに必要なものです。
ちなみにpython3-click-package
バージョン0.4.45.1+16.10.20160916-0~619~ubuntu14.04.1Ubuntu 17.04 リポジトリの一部です。
ライブラリの不一致の問題は次の手順で修正できます。
問題を解決するには、次の手順を実行してください。プロセス中に警告とエラーが表示されます。手順を複数回ループする必要があります。各ループでは、後続のクリーンアップが実行され、続行方法に関する情報が提供されます。
開始するには:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
指示が表示されたら、次のautoremove
操作を実行してください。
$ sudo apt-get autoremove
再起動が必要かどうかを確認します。以下を実行します。
$ [[ -f /var/run/reboot-required ]] && echo "Reboot Now"
再起動が必要な場合は、続行する前に再起動してください。
問題のあるアプリケーションを修正します。
$ sudo apt remove click --purge
$ sudo apt remove python3-click-package --purge
$ sudo apt autoremove
$ sudo apt install click
$ sudo apt remove python3-click-package
$ sudo apt autoremove
システムが自動的に更新やアップグレードを実行できるようにすると、通常の操作では手動コマンドはシームレスになります。手動メンテナンスを実行する場合、一部は非常に冗長に見えますが、それらは必要です。