0

Now that I have upgraded my Ubuntu to 17.04, the package system is broken. When I execute any APT commands, I get some error.

sudo apt --fix-broken install returns

enter image description here

dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg trying script from the new package instead...
dpkg: error processing archive /var/cache/archives/... (--unpack): there is no script in the new version of the package - giving up
Zanna
  • 70,465

1 Answers1

1

The problem is with the click package. You most likely have a python3 version of click installed through pip3. You just upgraded to 17.04 and have the click package installed with a version number under the pip or pip3 repository. Pip packages aren't managed by apt, and they take priority when Python's import keyword is invoked. So you need to uninstall the click package and then reinstall it.

Install click again to install the dependencies.

sudo apt-get install --reinstall click

Then remove it with this command.

sudo apt-get autoremove -f click

If that doesn't work, you can try it the hard way,

sudo rm /usr/bin/click

sudo apt-get autoremove -f click

Source:

How to get removed a broken package (in this case "click")?

Noisy_Botnet
  • 1,619
  • Why is autoremove used here? I would have treated this as a regular removal, maybe just a case for "dpkg --purge click". – pauljohn32 Apr 21 '17 at 09:10
  • Another take away from this should be DON'T RUN pip AS ROOT! It can replace files that are under package managment. Same reason to never run "make install" as root, unless you know what is going to happen. – pauljohn32 Apr 21 '17 at 09:13