How to completely remove ldap and remove the directory tree

A simple sudo dpkg-reconfigure slapd should perform the task.


apt-get remove --purge package

apt-get remove [--purge] Removes and any packages that depend on it. --purge specifies that packages should be purged

The difference between remove and purge is that while remove only deletes data and executables, purge also deletes all configuration files in addition.