Skip to content

Instantly share code, notes, and snippets.

@glw
Last active July 18, 2016 00:49
Show Gist options
  • Save glw/357800d218b3a5b10935 to your computer and use it in GitHub Desktop.
Save glw/357800d218b3a5b10935 to your computer and use it in GitHub Desktop.
postgis, pgrouting, qgis install on ubuntu 14
#The following will install Postgres, pgAdmin3, PostGIS, PGRouting, QGIS, and numix (for cooler icons)
#The ubuntugis launchpad repo provides all but pgrouting, pgAdmin and of course the numix icons, it provides similar versions of software - https://launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-unstable
#Currently on Ubuntu 14.x the universal package sources offer Posgresql 9.3, and Postgis 2.1.2 so there is no need to add repositories for these alone, unless looking for the most up-to-date version. In which case going straight to the source will be your best bet.
#! /bin/bash (include if you want to turn this into a script)
#install postgis postgresql pgadmin3 from PGDG Repo **See alternative installation below if interested in a more up-to-date QGIS.
#source: http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21UbuntuPGSQL93Apt
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt trusty-pgdg main" >> /etc/apt/sources.list'
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.3-postgis-2.1 pgadmin3 postgresql-contrib
#postgres set-up
sudo -u postgres psql
CREATE EXTENSION adminpack;
\q
sudo su - postgres
createuser -d -E -i -l -P -r -s gisuser
exit
#dont forget to edit hb_conif
#Depending on which source you get GDAL from you may find conflicting packages when trying to install QGIS. The issue has been brought up in issue trackers but is yet to be resolved. If you've installed postgis from ubuntugis-unstable and want to add the latest QGIS from ubuntugis-unstable, you should have no issues.
#To install qgis 2.x
sudo apt-get update
sudo apt-get install qgis=2.0
#or opt for ubuntugis-unstable for postgis 2.1.3 and qgis 2.6
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install postgresql-9.3-postgis-2.1 qgis
#install pgrouting
#source: https://launchpad.net/~georepublic/+archive/ubuntu/pgrouting-unstable?field.series_filter=trusty
sudo add-apt-repository ppa:georepublic/pgrouting-unstable
sudo apt-get update
sudo apt-get install postgresql-9.3-pgrouting osm2pgrouting pgrouting-workshop
#install numix for some nice looking icons
sudo add-apt-repository ppa:numix/ppa
sudo apt-get update
sudo apt-get install numix-icon-theme-circle
sudo apt-get update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment