How can I enable Shapefile GUI Loader in pgadmin3?

If you want a painless install, you might want to start over and use the OpenGeo Suite version of PostGIS.

$sudo wget -qO- http://apt.opengeo.org/gpg.key | apt-key add -
$sudo echo "deb http://apt.opengeo.org/ubuntu lucid main" >> /etc/apt/sources.list
$sudo apt-get update
$apt-cache search opengeo
$sudo apt-get install opengeo-postgis

Or you could just install the shape loader instead of the whole postgis package.

$sudo apt-get install opengeo-postgis-shapeloader  

It would be installed in /usr/sbin you need to make a symbolic link to $$PGBINDIR ( which in this case is in /usr/bin )

$sudo ln -s /usr/sbin/shp2pgsql-gui /usr/bin/shp2pgsql-gui

Finally, in your plugins.ini file:

;
; pgShapeLoader (Linux):
;
Title=PostGIS Shapefile and DBF loader
Command=$$PGBINDIR/shp2pgsql-gui -U $$USERNAME -d $$DATABASE -p $$PORT -h $$HOSTNAME
Description=Open a PostGIS ESRI Shapefile or Plain dbf loader console to the current database.
KeyFile=$$PGBINDIR/shp2pgsql-gui
Platform=unix
ServerType=postgresql
Database=Yes
SetPassword=No

As you're using pgadmin3 1.14.0, I think you need to place the plugins.ini under /usr/share/pgadmin3/plugins.d/. Lower versions put it under /usr/share/pgadmin3/


I can't believe I'm having the same issue in 2014 with 12.04.

Neither the GUI nor command-line shapeloader install using the opengeo-suite.

I simply followed the noob-friendly directions on this website: http://www.staygeo.com/2013/05/enabling-postgis-shapefile-and-dbf.html, which parallel the instructions by RK almost 2 years ago.

"Install opengeo-postgis2-shapeloader using this command at terminal:

sudo apt-get install opengeo-postgis2-shapeloader

It gets installed in /usr/lib/postgresql/9.2/bin as shp2pgsql-gui. Now create a symbolic link for the same in /usr/bin directory. Prior to this you may want to check if the postgresql version you have is 9.2.

sudo ln -s /usr/lib/postgresql/9.2/bin/shp2pgsql-gui /usr/bin/shp2pgsql-gui 

Now it's the time to edit plugins.d file. Use the following command to open the file for editing:

gksudo gedit /usr/share/pgadmin3/plugins.d/plugins.ini

Paste the following contents at the end of the file:

;
; pgShapeLoader (Linux):
;
Title=PostGIS Shapefile and DBF loader
Command=$$PGBINDIR/shp2pgsql-gui -U $$USERNAME -d $$DATABASE -p $$PORT -h $$HOSTNAME
Description=Open a PostGIS ESRI Shapefile or Plain dbf loader console to the current database.
KeyFile=$$PGBINDIR/shp2pgsql-gui
Platform=unix
ServerType=postgresql
Database=Yes
SetPassword=No

Note: You may have to set the environment variable PGBINDIR on your machine. To check if the environment variable is already set type this on your terminal:

echo $PGBINDIR

If an empty line appears as a result, it indicates that environment variable is not set. You will have to set it to /usr/bin (the location where the symbolic link for shapefile loader resides). For that use this command:

PGBINDIR=/usr/bin

Once the above steps are done invoke pgAdmin III to see the 'PostGIS Shapefile and DBF Loader' listed under plugins."

No copyright intended (it's well-written so I didn't paraphrase :).


This response may be late,but i had the same trouble and i found the solution. Try this command on your terminal :

$sudo ln -s /usr/lib/postgresql/9.1/bin/shp2pgsql /usr/bin/shp2pgsql