PostgreSQL Installation – PDPG Support for Ubuntu 16.10 Yakkety

installationpostgresqlUbuntu

The official repository does not have Yakkety (16.10 packages). It seems it stops at Xenial.

Best Answer

PostgreSQL's PDPG only creates separate packages for LTS releases, however it seems to suggest that it should work in the FAQ

I am using a non-LTS release of Ubuntu Non-LTS releases of Ubuntu are only added to the repository if the packages from the latest LTS release are incompatible with the release in question. Using the latest LTS release instead generally works, unless library dependencies cannot be fulfilled, in which case we will provide updated packages for the non-LTS release.

I'm a little hesitant to spring for generally works, but there you have it.

So do not run the suggested command,

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

Instead, run

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

Warning, I wasn't not able to get this to work... Installing postgis failed.

 postgresql-9.6-postgis-2.3 : Depends: libgdal1i (>= 1.9.0) but it is not installable
                              Recommends: postgresql-contrib-9.6 but it is not going to be installed

Ubuntu 16.10 does not ship with libgdal1i, it ships with libgdal20 and libgdal-dev which uses 2.1.1. Bug filed here