1

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?

4
  • Did you run sudo apt-get purge spotify? That is the proper way to remove a package.
    – Durandal
    Dec 4, 2015 at 14:52
  • Also try to run sudo apt-get install -f. The package sounds like it's broken. The -f prefix checks all installed packages and tries to fix them.
    – Durandal
    Dec 4, 2015 at 14:56
  • @Ev1l0rd Yes I did try but as I said I accidentally removed a folder of Spotify so now it can't be uninstalled.
    – yotamN
    Dec 5, 2015 at 3:38
  • The general recommendation for such a case is to re-install the package (--force-fully, if necessary) with apt-get install --reinstall or dpkg -i to restore the missing files, then remove the package as usually. Dec 5, 2015 at 9:54

3 Answers 3

2

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
2
  • I tried this and the commands didn't output any error but I still can't get rid of Spotify, apt-get remove spotify-client didn't work
    – yotamN
    Dec 7, 2015 at 19:10
  • What's the output of that command now? Still the same? If not, please add the new output to your question and give me a ping. Jan 2, 2016 at 11:32
1

Download the spotify-client deb package from the repo:

cd ~/Downloads && apt-get download spotify-client

Install it with dpkg

sudo dpkg -i --force-all --no-triggers downloaded_deb

If 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.

5
  • It didn't work, it returned error 127
    – yotamN
    Dec 5, 2015 at 3:37
  • Which of these command returned the error code? What was the program output? Please include your actions and findings in your original question. This makes it easier to address them properly. Dec 5, 2015 at 9:52
  • @DavidFoerster this is the error I get when I try the second command
    – yotamN
    Dec 5, 2015 at 14:52
  • @yotamN I've updated my answer. Please try it out and tell us if it works.
    – Tung Tran
    Dec 7, 2015 at 4:20
  • @TungTran Sadly reinstalling dpkg didn't work, this is the error I got: pastebin.com/Dfm6ReRD
    – yotamN
    Dec 7, 2015 at 19:08
0

Did you try?

    sudo apt-get purge spotify-client
    sudo apt-get install -f spotify-client
1
  • It didn't work, I can't purge spotify and the installation also failed.
    – yotamN
    Dec 5, 2015 at 3:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .