由于从 Ububtu 14 升级到 18 时遇到此升级错误,

由于从 Ububtu 14 升级到 18 时遇到此升级错误,

pip3 不再适用于安装 click_package,我手动下载并安装了适用于 python 3.6 的 click 包,但没有找到要下载和安装的 click_pakage。你能帮我解决这个问题吗?

$ 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:
 upstart-app-launch : Depends: upstart (>= 1.11) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

sajid@sajid-Inspiron-7737:bin$ 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:
  account-plugin-tools accountsservice-ubuntu-schemas antlr3 apparmor-easyprof-ubuntu  
......
......
qtdeclarative5-dev-tools qtdeclarative5-ofono0.2 qtdeclarative5-online-accounts-client0.1 qtdeclarative5-ubuntu-content1 ruby2.3 snapd-login-service system-image-common
  system-image-dbus ubuntu-application-api3-test ubuntu-download-manager ubuntuone-credentials-common urfkill x11proto-xinerama-dev
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  upstart-app-launch
0 upgraded, 0 newly installed, 1 to remove and 499 not upgraded.
After this operation, 236 kB disk space will be freed.

Do you want to continue? [Y/n] y

(Reading database ... 446556 files and directories currently installed.)
Removing upstart-app-launch (0.3+14.04.20140411-0ubuntu1) ...
Traceback (most recent call last):
  File "/usr/bin/click", line 37, in <module>
    import click_package as click
ModuleNotFoundError: No module named 'click_package'
dpkg: error processing package upstart-app-launch (--remove):
 installed upstart-app-launch package pre-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 upstart-app-launch
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

您需要删除相应的、、python3-click-package包:python3-clickclick

sudo apt-get update
sudo apt-get purge python3-click-package python3-click click

然后恢复软件包安装并安装升级后的软件包依赖项:

sudo dpkg --configure -a
sudo apt-get install -f
sudo apt-get dist-upgrade

答案2

通过使用以下命令手动删除点击即可解决问题。

sudo rm /usr/bin/click

sudo apt-get --fix-broken 安装

比我用的

sudo apt-get 更新

sudo apt-get 升级

现在一切看起来都很好

相关内容