5

I am in a situation where package click is broken. I have tried many things, but did not manage to fix it.

$ sudo apt dist-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.43+16.04.20160203-0ubuntu2) but 0.4.43+16.04.20170613-0ubuntu1 is installed
E: Unmet dependencies. Try using -f.

Obvioulsy sudo apt-get -f install does not fix it. Nor trying to remove python3-click-package.

Any help welcomed.

$ apt-cache policy click python3-click-package
click:
  Installed: 0.4.43+16.04.20160203-0ubuntu2
  Candidate: 0.4.43+16.04.20170613-0ubuntu1
  Version table:
     0.4.43+16.04.20170613-0ubuntu1 500
        500 http://gb.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
 *** 0.4.43+16.04.20160203-0ubuntu2 500
    500 http://gb.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
    100 /var/lib/dpkg/status
python3-click-package:
  Installed: 0.4.43+16.04.20170613-0ubuntu1
  Candidate: 0.4.43+16.04.20170613-0ubuntu1
  Version table:
 *** 0.4.43+16.04.20170613-0ubuntu1 500
        500 http://gb.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     0.4.43+16.04.20160203-0ubuntu2 500
        500 http://gb.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

I can not even remove the package:

$sudo apt-get -f purge click
The following packages will be REMOVED
  click*
0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade.
2 not fully installed or removed. 
After this operation, 88.1 kB disk space will be freed.
Do you want to continue? [Y/n] y 
(Reading database ... 590369 files and directories currently installed.)
Removing click (0.4.43+16.04.20160203-0ubuntu2) ...
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 package click (--purge):
 subprocess installed pre-removal script returned error exit status 1
Job for click-system-hooks.service failed because the control process     exited with error code. See "systemctl status click-system-hooks.service" and "journalctl -xe" for details.
click-system-hooks.service couldn't start.
Errors were encountered while processing:
 click
E: Sub-process /usr/bin/dpkg returned an error code (1)
  • What is the output of apt-cache policy click python3-click-package? – fkraiem Jun 20 '17 at 10:57
  • Looks like you disabled the xenial-updates repo. Enable it. – user535733 Jun 20 '17 at 11:39
  • xenial-updates is enabled. – Se6 Jun 20 '17 at 13:01
  • Updated post with apt-cache policy output. – Se6 Jun 20 '17 at 13:49
  • What if you simply run sudo apt install click? – Gunnar Hjalmarsson Jun 20 '17 at 17:55
4

Managed to sort it out with:

sudo apt install python3-click-package=0.4.43+16.04.20160203-0ubuntu2 gir1.2-click-0.4=0.4.43+16.04.20160203-0ubuntu2 libclick-0.4-0=0.4.43+16.04.20160203-0ubuntu2

I built that command step by step following the messages in the unmet dependencies... Then I was able to fully remove the click package...

sudo apt purge click
  • Does not seem to work. I get the same error. – jjmerelo Feb 24 '19 at 10:37
2

I had to remove the file /usr/bin/click first to make sudo apt-get purge clickwork again. After that i installed click via pip.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.