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?
43 Answers
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-clientThen you should be able to uninstall it normally:
sudo apt-get remove spotify-client 2 Download the spotify-client deb package from the repo:
cd ~/Downloads && apt-get download spotify-clientInstall it with dpkg
sudo dpkg -i --force-all --no-triggers downloaded_debIf it works, you will be able to remove it properly.
If it doesn't work but returns 127 error, you may need to reinstall dpkg, this is a tip to overcome the uncompleted installation of a package (In your case, the folder of Spotify was accidentally removed). As soon as dpkg is reinstalled, you redo the command sudo dpkg -i --force-all --no-triggers downloaded_deb.
Did you try?
sudo apt-get purge spotify-client sudo apt-get install -f spotify-client 1