如何删除破损的包(在这种情况下“点击”)?

如何删除破解包点击 ? 我正在尝试在我的14.04 Ubuntu中安装ubuntu-sdk。 我收到太多错误。

sudo apt-get autoremove -f click Reading package lists ... Done Building dependency tree Is read status information ... Done The following packages will be REMOVED: click 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation released 166 ks of disk space. Do you want to continue? [Y/n] y (Reading database ... 350824 files and directories currently installed.) Removing click (0.4.38.5-0~457~ ubuntu14.04.1) ... Trace Back (most recent call last): File "/usr/bin/click", line 31, in  from click import commands Import Error: can not import name 'commands' dpkg: error processing package click (--remove): subprocess command file pre-removal installed returned error exit status 1 Reading was too many errors: click E: Sub-process /usr/bin/dpkg Returned an error code (1) 

如果我正在尝试命令sudo apt-get purge -f

发生同样的错误。

在那之后没有成功,我已经测试了这个“艰难的方式”……并且……它有效!

 sudo rm /usr/bin/click sudo apt-get autoremove -f click 

导入Python模块时,该文件存在问题,并且您仍想要删除该包。 因此,可以手动删除该文件。

我有与破坏的软件包相同的错误点击点击-apparmor,升级14.04后的url-dispatcher – > 14.10 – > 15.04

*更新:

我的解决方案是删除包文件夹rm -rv /usr/local/lib/python3.4/dist-packages/click然后:

sudo apt-get update && sudo apt-get install -f

解决方案来源

 sudo apt-get remove click sudo pip3 uninstall click sudo pip uninstall click sudo apt-get install click -f 

问题是许多升级用户将在其pip或pip3存储库下安装版本号为click的版本,这些版本不是由apt管理的,并且在调用Python的import关键字时它们优先。

因此,您需要在重新安装之前卸载它们。点击将对您有所帮助。 它们可能被安装的原因是它可能在第三方python应用程序的设置期间发生,并且上帝知道我做了一些。

再次安装单击以安装依赖项。

 sudo apt-get install --reinstall click 

然后使用此命令将其删除。

 sudo apt-get autoremove -f click 

如果这不起作用,那么安装python和/或python3:

 sudo apt-get install --reinstall python sudo apt-get install --reinstall python3 sudo apt-get install --reinstall python3-click 

而不是再一次

 sudo apt-get autoremove -f click 

你可以试试:

 sudo dpkg --force-all -P click 

要么:

 sudo dpkg --force-all -r click 

在我的情况下,这是因为我也通过pip3安装了python3版本的点击。 当我卸载python3版本时一切正常。