[GIS] How to remove old partially installed postgis 2.0 from Mac

postgis

I am trying to install postgis in mac using brew. However it shows that postgis-2.0.0 is already installed. Actually I tried to install it from source. Up to configuration it was fine but when I did make, it showed some errors and didn't continue. Further I installed postgresql from brew so I think it would be better to install postgis from brew as well.

How can I remove this old partially installed postgis of version 2.0.0

Best Answer

rajan, if you still have the source build folder where you tried to install PostGIS 2 from, open up Terminal and try these commands:

cd <postgis-2.0.0 source folder>
sudo make uninstall

If that folder has been deleted, start by un-archiving the source download, then:

cd <postgis-2.0.0 source folder>
./configure
sudo make uninstall

./configure will probably fail if PostgreSQL is not already installed. Both of these options are an attempt to have the Makefile, created by ./configure script, provide an uninstall solution for you. I'm not entirely sure PostGIS offers an uninstall option, though. Then you can try the homebrew install again.

EDIT: This is where PostGIS 2 says it installs stuff, if you want to manually remove things (from README.postgis in source, pg_config refers to PostgreSQL config file):

Installation paths will typically be derived by ``pg_config``:

 - Lib in ``pg_config --pkglibdir``
 - Binaries (loader/dumper) in ``pg_config --bindir``
 - Important support files in ``[prefix]/share/contrib``
 - Manual pages in ``[prefix]/man``
 - Documentation in in ``[prefix]/share/doc``

Where `[prefix]` above is extracted from ``pg_config --configure``.

I highly recommend, if you are using a Mac, to look into using the PostgreSQL and PostGIS package installers provided by KyngChaos.com. He provides many up-to-date, stable package installers for open source geo software, if you are running Snow Leopard or Lion.