Postgresql – How to completely remove EnterpriseDB Installation of Postgresql on Ubuntu

enterprisedbpostgresqlpostgresql-9.3Ubuntu

All,

I'm trying to install/run PostgreSQL 9.3, but am receiving a multitude of errors which seem to point to a failed installation of postgresql from the enterpriseDB package.

For example, trying to start the server with this command:

sudo /etc/init.d/postgresql-9.3 restart (or start)

…yields the following:

Restarting PostgreSQL 9.3: 
-su: /opt/PostgreSQL/9.3/bin/pg_ctl: No such file or directory
PostgreSQL 9.3 did not start in a timely fashion, please see /opt/PostgreSQL/9.3/data/pg_log/startup.log for details

Except there is no /opt/PostgreSQL/ folder, and I've been told that creation of that was attempted during the EnterpriseDB installation…why the start command is trying to go there, I do not know!

I've started another thread which gave me a very temporary solution, but that doesn't seem to help after I do a restart of my machine.

So the question, how do I completely remove the EnterpriseDB failed installation?

I've tried these commands, but the issue still lingers:

sudo apt-get autoremove postgresql-9.3-postgis pgadmin3
sudo apt-get --purge remove postgresql\*

Any thoughts or recommendations are welcome!

Thank you!

-m

Best Answer

In Feb 2009, Scahin_S wrote in [1] to use the uninstall-postgresql binary. In the same thread Sachin_S also documented a manual alternative for uninstalling 8.3 is

/opt/PostgreSQL/8.3/installer/server/removeshortcuts.sh /opt/PostgreSQL/8.3 8.3 
/etc/init.d postgresql-8.3 stop 
rm -rf /opt/PostgreSQL 
rm /etc/postgres-reg.ini 
rm -rf /etc/init.d/postgresql-8.3 
userdel postgres 

if /etc/ld.so.conf exists, edit it and remove /opt/PostgreSQL/8.3/lib 
if present. 

if /etc/ld.so.conf.d exists: 

rm /etc/ld.so.conf.d/postgresql-8.3.conf

1 - "Uninstall Postgres" thread Enterprise DB "PostgreSQL Installers for Windows, Linux and OS X" forum http://forums.enterprisedb.com/posts/list/1437.page