1

Alright so here is my problem, I tried installing Spotify. It wasn't going well so I decided to uninstall it. Being a complete n00b I though deleting the folder where it was installed to would solve my problem. I googled how to properly delete a package and now it wont work, at all.

(Reading database ... 95881 files and directories currently installed.)
Removing spotify-client ...
/var/lib/dpkg/info/spotify-client.prerm: 9: cd: can't cd to /opt/spotify/spotify-client
dpkg: error processing spotify-client (--remove):
subprocess installed pre-removal script returned error exit status 2
/var/lib/dpkg/info/spotify-client.postinst: 5: cd: can't cd to /opt/spotify/spotify-client
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
spotify-client
E: Sub-process /usr/bin/dpkg returned an error code (1)

I am more lost than I was before, please help.

Content of /var/lib/dpkg/info/spotify-client.prerm:

#!/bin/sh
#
# Copyright (c) 2012 Spotify AB

# We could be smart and not clean up on upgrade,
# but I worry that we'll leave old crap around
# when we change things.

cd /opt/spotify/spotify-client && ./unregister.sh
2
  • 1
    Post the content of /var/lib/dpkg/info/spotify-client.prerm
    – kos
    Apr 26, 2015 at 23:04
  • @kos here is the hastebin link Apr 26, 2015 at 23:09

2 Answers 2

3

The removal is failing because the pre-removal script can't be executed with success due to the failure of the cd command (such directory doesn't exist anymore); comment this line in /var/lib/dpkg/info/spotify-client.prerm by putting a # at the start:

cd /opt/spotify/spotify-client && ./unregister.sh

so that it becomes like this one:

# cd /opt/spotify/spotify-client && ./unregister.sh
1
  • thank you very much! I probably should have read that error message more carefully, lesson learned. Apr 26, 2015 at 23:19
1

You could always re-install Spotify, then use the proper method to remove it. That way, you will have all the needed files on the system again.

You must log in to answer this question.

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