![从 16.04 升级到 16.10 时出错](https://linux22.com/image/1144895/%E4%BB%8E%2016.04%20%E5%8D%87%E7%BA%A7%E5%88%B0%2016.10%20%E6%97%B6%E5%87%BA%E9%94%99.png)
我确实sudo apt dist-upgrade
升级了我的 Ubuntu 发行版,但遇到了这个错误
Cannot start click due to a conflict with a different locally-installed Python 'click' package. Remove it using Python packaging tools and try again.
dpkg: error processing package click (--configure):
subprocess installed post-installation script returned error exit status 1
我按照答案中给出的方式卸载了本地 Python 3 click 包这里之后我尝试了sudo apt-get install -f
,但现在失败了,说
Setting up click-apparmor (0.3.17) ...
Traceback (most recent call last):
File "/usr/bin/click", line 37, in <module>
import click
ImportError: No module named 'click'
dpkg: error processing package click-apparmor (--configure):
subprocess installed post-installation script returned error exit status 1
click
由于已被卸载,因此无法导入。我在 AskUbuntu 上找不到与此相关的任何其他内容。
尝试apt-cache policy click python-click python3-click
输出如下:
Installed: 0.4.45.1+16.10.20160916-0ubuntu1
Candidate: 0.4.45.1+16.10.20160916-0ubuntu1
Version table:
*** 0.4.45.1+16.10.20160916-0ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu yakkety/main amd64 Packages
100 /var/lib/dpkg/status
0.4.43+16.04.20160203-0ubuntu2 500
500 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
python-click:
Installed: (none)
Candidate: 6.6-1
Version table:
6.6-1 500
500 http://us.archive.ubuntu.com/ubuntu yakkety/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu yakkety/main i386 Packages
6.2-2ubuntu1 500
500 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
500 http://in.archive.ubuntu.com/ubuntu xenial/universe i386 Packages
500 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 Packages
python3-click:
Installed: (none)
Candidate: 6.6-1
Version table:
6.6-1 500
500 http://us.archive.ubuntu.com/ubuntu yakkety/universe amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu yakkety/universe i386 Packages
6.2-2ubuntu1 500
500 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
500 http://in.archive.ubuntu.com/ubuntu xenial/universe i386 Packages
500 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu xenial/universe i386 Packages
并sudo dpkg--audit
输出:
The following packages have been unpacked but not yet configured.
They must be configured using dpkg --configure or the configure
menu option in dselect for them to work:
ubuntu-app-launch Session init system job for Launching Applications
ubuntu-app-launch-tools Tools for working wtih launched applications
ubuntu-system-settings System Settings application for Ubuntu Touch
unity-greeter-session-broadcast Service to allow the greeter to communicate to
url-dispatcher-tools tools for working with the URL Dispatcher.
The following packages are only half configured, probably due to problems
configuring them the first time. The configuration should be retried using
dpkg --configure <package> or the configure menu option in dselect:
click Click packages
click-apparmor Click manifest to AppArmor easyprof conversion tools
url-dispatcher:amd64 service to allow sending of URLs and get handlers started
任何帮助都将受到赞赏。
答案1
删除非 Ubuntu 存储库,然后单击,然后当您再次收到此错误时:
Setting up click-apparmor (0.3.17) ...
Traceback (most recent call last):
File "/usr/bin/click", line 37, in <module>
import click
ImportError: No module named 'click'
dpkg: error processing package click-apparmor (--configure):
subprocess installed post-installation script returned error exit status 1
重命名
click-apparmor
安装后脚本以跳过它,使用:sudo mv /var/lib/dpkg/info/click-apparmor.postinst /var/lib/dpkg/info/click-apparmor.postinst.backup
继续卡住的安装:
sudo apt-get install -f
安装 Ubuntu 存储库,单击 python 模块
sudo apt install python3-click-package python3-click python-click
如果有效,请放回安装后脚本
sudo mv /var/lib/dpkg/info/click-apparmor.postinst.backup /var/lib/dpkg/info/click-apparmor.postinst sudo dpkg-reconfigure click-apparmor