Unable to Install Samba after uninstalling?

Solution 1:

I guess it's because you uninstalled samba only and wiped out the config file so something stayed installed and without configuration.

I think there are ways to repair, but I would try to reinstall on a "clean" base doing:

sudo dpkg -P samba samba-common smbclient
sudo rm -f /etc/rc*.d/*samba /etc/init.d/samba

before anything and reinstall with sudo apt-get install samba

Solution 2:

You have a incompatible shared library in /usr/local. That was installed separately, not as part of a Debian package (Debian packages are not allowed to install to /usr/local). You should remove it, and any other related shared libraries in /usr/local, uninstall all SAMBA packages, then reinstall

Note that the grep result means no process containing "samba" is executing. Only the grep is running; I know this looks a little confusing.

EDIT:

Okay, try:

sudo rm /usr/local/lib/libldap_r-2.4.so.2

This removes a shared library that was separately installed to /usr/local. You may have others there, but you removing the wrong ones could break your system.

sudo apt-get remove samba samba-common smbclient swat samba-doc smbfs libpam-smbpass libsmbclient libsmbclient-dev winbind

This removes all samba-related packages.

Now, reinstall what you need. E.g.:

sudo apt-get install samba

EDIT 2:

Nikolaidis is right. Manually removing all the SAMBA config files was a mistake. Do:

sudo cp /usr/share/samba/smb.conf /etc/samba/smb.conf
sudo dpkg --configure -a