Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having a problem with Samba package. So I did the following to remove it, and got some errors.

# sudo apt-get --purge remove samba-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  samba* samba-common* samba-common-bin*
0 upgraded, 0 newly installed, 3 to remove and 6 not upgraded.
4 not fully installed or removed.
After this operation, 42.4 MB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 195751 files and directories currently installed.)
Removing samba ...
Purging configuration files for samba ...
Removing configuration file /etc/default/samba...
Removing configuration file /etc/default/samba...
Removing samba-common-bin ...
Removing samba-common ...
Purging configuration files for samba-common ...
**perl: error while loading shared libraries: cannot open shared object file: No such file or directory
dpkg: error processing samba-common (--purge):
 subprocess installed post-removal script returned error exit status 127
Processing triggers for man-db ...
perl: error while loading shared libraries: cannot open shared object file: No such file or directory
Processing triggers for ureadahead ...
Processing triggers for ufw ...
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any ideas?

share|improve this question
Did you remove any files manually, before trying out the above command? – Hashken Jun 21 '12 at 7:43

Try sudo apt-get autoremove and then sudo apt-get purge samba*.

share|improve this answer

Run these commands in terminal (ctrl+alt+t):

sudo apt-get -f install
sudo apt-get install perl
sudo apt-get purge samba*
sudo apt-get autoremove
share|improve this answer
Could you provide a bit more detail, to the questioner, as to what these four commands do? This may be their solution, but it would help them grow to know how/why this solves it. – gravity Jun 6 at 19:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.