Ubuntu – Accidentally removed Spotify folder, now I can’t uninstall anything

aptcommand lineuninstall

I accidentally removed Spotify folder and now I can't uninstall programs from with apt-get or the Software Center, when I try to remove the flash plugin from the command line it give me this error:

/var/lib/dpkg/info/spotify-client.postinst: 5: /var/lib/dpkg/info/spotify-client.postinst: ./register.sh: not found
dpkg: error processing package spotify-client (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 spotify-client
E: Sub-process /usr/bin/dpkg returned an error code (1)

What to do?

Best Answer

Since it seems, that the Spotify package is still in the “configured” state, but had some of its files removed, you need to reinstall it first:

sudo apt-get install -f --reinstall spotify-client

Then you should be able to uninstall it normally:

sudo apt-get remove spotify-client
Related Question