2

So I was reading to learn on how packages and package installation works in Ubuntu in general and where do the files responsible for the existence of any application (installation files) reside in my file system. I learnt that when a package manager installs an application, spotify for example, it will place different files in different locations, and that by using the command

sudo dpkg -L spotify-client

as an example, I would be able to see where that spotify application installation files are scattered through the file system. So I decided I wanted to remove them manually and practice what I just learnt (I wish I hadn't) and I headed to every location and performed a disastrous

sudo rm -r

command to remove a file at a time.

After that I thought that my spotify would disappear from the system and everybody will be happy but I started to see this error whenever attempting to install or remove any package

# sudo apt-get install grive
Reading package lists... Done
Building dependency tree       
Reading state information... Done
grive is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 42 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up spotify-client (1:0.9.17.1.g9b85d43.7-1) ...
/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)

1 Answer 1

1

Removing files, installed by a package is always a bad idea. Edit the file /var/lib/dpkg/info/spotify-client.postinst

sudo nano /var/lib/dpkg/info/spotify-client.postinst

and remove the line, if present

set -e

Save and close and run

sudo apt-get purge spotify-client

But as you say:

by using the command "sudo dpkg -L spotify-client", as an example, to see where that spotify application installation files are scattered through the file system. So I decided I wanted to remove them manually

You can also remove the spotify-client installation and removal scripts in /var/lib/dpkg/info/. More you can't break.

sudo rm /var/lib/dpkg/info/spotify-client.*
sudo apt-get purge spotify-client
sudo apt-get install -f
8
  • The file I nanoed to looks like this
    – Ramy Farid
    Nov 20, 2015 at 10:43
  • Sorry I was hitting return to format a block of line but I am failing :D The file contains just: cd /opt/spotify/spotify-client && ./register.sh && ./linklibs.sh
    – Ramy Farid
    Nov 20, 2015 at 10:46
  • Ok, updated my answer
    – A.B.
    Nov 20, 2015 at 10:48
  • The following error appeared: Removing spotify-client (1:0.9.17.1.g9b85d43.7-1) ... /var/lib/dpkg/info/spotify-client.prerm: 9: /var/lib/dpkg/info/spotify-client.prerm: ./unregister.sh: not found dpkg: error processing package spotify-client (--purge): subprocess installed pre-removal script returned error exit status 127 Errors were encountered while processing: spotify-client E: Sub-process /usr/bin/dpkg returned an error code (1)
    – Ramy Farid
    Nov 20, 2015 at 10:54
  • Do you think I should remove all the three files in /var/lib/dpkg/info that are related to spotify? will that help? I currently see three files there which are spotify-client.list and spotify-client.md5sums and spotify-client.prerm
    – Ramy Farid
    Nov 20, 2015 at 10:57

You must log in to answer this question.

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