6.4. Uninstalling Directory Server
It is possible to remove a single instance of Directory Server without uninstalling the system. To do this, run the following:
/usr/sbin/ds_removal -sserver_id-wadmin_password
The ds_removal script unregisters the server from the Configuration Directory Server and removes any related files and directories. The key and cert files are left in the instance configuration directory, and the configuration directory is renamed instance-name.removed.
To uninstall Red Hat Directory Server entirely, do the following:
Remove all of the Directory Server instances. Each Directory Server instance service must be running for the remove script to access it.
/usr/sbin/ds_removal -s example1 -w itsasecret /usr/sbin/ds_removal -s example2 -w itsasecret /usr/sbin/ds_removal -s example3 -w itsasecret
Stop the Administration Server.
/etc/init.d/dirsrv-admin stop
Then use the system tools to remove the packages. For example, on Red Hat Enterprise Linux 4, do the following:
rpm -ev dirsec-nss dirsec-nspr dirsec-nss-tools --nodeps rpm -ev svrcore mozldap6 mozldap6-tools perl-Mozilla-LDAP --nodeps rpm -ev redhat-ds-base --nodeps rpm -ev redhat-ds-admin redhat-ds-console redhat-admin-console --nodeps rpm -ev idm-console-framework redhat-idm-console --nodeps
On Red Hat Enterprise Linux 5, the packages to remove are as follows:
rpm -ev svrcore mozldap mozldap-tools perl-Mozilla-LDAP --nodeps rpm -ev redhat-ds-base --nodeps rpm -ev redhat-ds-admin redhat-ds-console redhat-admin-console --nodeps rpm -ev idm-console-framework redhat-idm-console --nodeps
To uninstall Red Hat Directory Server entirely, do the following:
Remove all of the Directory Server instances.
/opt/dirsrv/sbin/ds_removal -s example1 -w itsasecret /opt/dirsrv/sbin/ds_removal -s example2 -w itsasecret /opt/dirsrv/sbin/ds_removal -s example3 -w itsasecret
Stop the Administration Server.
/opt/dirsrv/sbin/stop-ds-admin
Remove the directory where the Directory Server is installed. For example:
rm -Rf /export/ds80
Remove the symlinks to the directories. For example:
rm -f /opt/dirsrv /var/opt/dirsrv /etc/opt/dirsrv
To uninstall Red Hat Directory Server entirely, do the following:
Remove all of the Directory Server instances.
/usr/sbin/ds_removal -s example1 -w itsasecret /usr/sbin/ds_removal -s example2 -w itsasecret /usr/sbin/ds_removal -s example3 -w itsasecret
Stop the Administration Server.
/etc/init.d/dirsrv-admin stop
Then use the system tools to remove the packages. For example:
#!/bin/bash
for i in `pkginfo | grep -i rhat | grep -vi rhatperlx | awk '{print $2}'`
do
pkgrm -n $i
done
echo "looking for any leftover RHAT packages ..."
pkginfo | grep RHAT