更新至 16.10 后出现 Dpkg 错误

更新至 16.10 后出现 Dpkg 错误

运行任何 apt 命令都会告诉我install -f。如果我运行apt install -f,我会得到以下信息:

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:
  bsdcpio cgmanager cl-swank cpp-5-doc fgetty fonts-texgyre foomatic-db-gutenprint fp-compiler-2.6.4 fp-docs-2.6.4
  fp-ide-2.6.4 fp-units-base-2.6.4 fp-units-db-2.6.4 fp-units-fcl-2.6.4 fp-units-fv-2.6.4 fp-units-gfx-2.6.4
  fp-units-gtk2-2.6.4 fp-units-math-2.6.4 fp-units-misc-2.6.4 fp-units-multimedia-2.6.4 fp-units-net-2.6.4
  fp-units-rtl-2.6.4 fp-utils-2.6.4 fpc-2.6.4 fpc-source-2.6.4 gcc-5-base:i386 gimp-gutenprint gnupg-curl gnupg-doc
  gnuplot5-doc gobjc-5 gobjc-5-multilib guile-2.0 guile-2.0-doc guile-gnutls gutenprint-doc gutenprint-locales
  ijsgutenprint lazarus-1.4.0 lazarus-doc-1.4.0 lazarus-ide-1.4.0 lazarus-ide-gtk2-1.4.0 lazarus-src-1.4.0
  lcl-1.4.0 lcl-gtk2-1.4.0 lcl-nogui-1.4.0 lcl-units-1.4.0 lcl-utils-1.4.0 lib32objc-5-dev lib32objc4
  liballegro-acodec5.0 liballegro-audio5.0 liballegro-dialog5.0 liballegro-image5.0 liballegro-ttf5.0
  libapparmor1:i386 libboost-atomic1.58.0 libboost-chrono1.58.0 libboost-context1.58.0 libboost-coroutine1.58.0
  libboost-graph-parallel1.58.0 libboost-graph1.58.0 libboost-locale1.58.0 libboost-log1.58.0 libboost-math1.58.0
  libboost-mpi1.58.0 libboost-random1.58.0 libboost-serialization1.58.0 libboost-test1.58.0 libboost-timer1.58.0
  libboost-wave1.58.0 libclutter-1.0-dbg libclutter-gst-2.0-0 libclutter-gtk-1.0-dbg libgail-3-0-dbg libgail-dbg
  libglpk36 libgnomeada2.24.4 libgnuplot-iostream-dev libgrilo-0.2-1 libgsm1:i386 libgutenprintui2-1
  libhunspell-1.3-0-dbg libicu55-dbg libiscsi2 libjson-c2:i386 libkadm5clnt-mit9 libkadm5srv-mit9
  libkf5dbusaddons-bin libkf5gapidrive5 libkf5iconthemes-bin libkf5identitymanagement5 libkf5pimtextedit5
  libkf5xmlgui-bin liblink-grammar4 liblivemedia50 libnewt0.52:i386 libobjc-5-dev libode4 libpango1.0-0-dbg
  libprocps4 libreadline7:i386 librhythmbox-core9 libroar-plugins-universal libsctp1 libsidutils0 libtinfo-dev:i386
  libtinyxml2-2v5 libvpx3:i386 libwacom-bin libwebpdemux1 libwebrtc-audio-processing-0 libx32objc-5-dev libx32objc4
  libxapian-dev lksctp-tools myspell-lt python-gnuplot python-pyatspi python3-dbus.mainloop.qt
  qml-module-org-kde-activities sonnet-plugins tex4ht-common xapian-examples
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  click-apparmor
The following packages will be upgraded:
  click-apparmor
1 upgraded, 0 newly installed, 0 to remove and 2055 not upgraded.
6 not fully installed or removed.
Need to get 0 B/10.7 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]

如果我按下y,我会得到:

(Reading database ... 1598890 files and directories currently installed.)
Preparing to unpack .../click-apparmor_0.3.17_amd64.deb ...
Traceback (most recent call last):
  File "/usr/bin/click", line 55, in <module>
    from click import commands
ImportError: cannot import name 'commands'
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Traceback (most recent call last):
  File "/usr/bin/click", line 55, in <module>
    from click import commands
ImportError: cannot import name 'commands'
dpkg: error processing archive /var/cache/apt/archives/click-apparmor_0.3.17_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/click-apparmor_0.3.17_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

dpkg --configure -a没有输出。我无法删除或清除clickpython3-apparmor-click因为ubuntu-app-launch依赖于它们,并且从阅读描述来看,ubuntu-app-launch这很重要。

我不能,install python3-apparmor-click=0.3.13.1因为虽然这是版本click想要的,但它似乎不存在。

我可以在这里做什么?

答案1

最终的解决方案是:

  • sudo rm `which click`
  • apt autoremove -f click click-apparmor ubuntu-app-launch
  • sudo reboot
  • apt update
  • do-release-upgrade(完成中断的升级)

并且apt已再次开始工作。

相关内容