14. Appendix: Installation

For this workshop you need:

  • Linux operating system like Ubuntu
  • An editor like Gedit, Medit or similar
  • Geoserver for the routing application
  • Internet connection

Install pgRouting on a Windows computer.

The following reference is a quick summary of how to install it on your own computer running Ubuntu 14.04 or later.

Ubuntu

pgRouting on Ubuntu can be installed using packages from a PostgreSQL repository:

Using a terminal window:

# Create /etc/apt/sources.list.d/pgdg.list. The distributions are called codename-pgdg.
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

# Import the repository key, update the package lists
sudo apt install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update

# Install pgrouting based on your postgres Installation: for this example is 10
sudo apt install postgresql-10-pgrouting

This will also install all required packages such as PostgreSQL and PostGIS if not installed yet.

To be up-to-date with changes and improvements

sudo apt-get update & sudo apt-get upgrade

To avoid permission denied errors for local users you can set connection method to trust in /etc/postgresql/<version>/main/pg_hba.conf and restart PostgreSQL server with sudo service postgresql restart.

Following the example with PostgreSQL 10:

sudo nano /etc/postgresql/10/main/pg_hba.conf

local   all             postgres                                trust
local   all             all                                     trust
host    all             all             127.0.0.1/32            trust
host    all             all             ::1/128                 trust