Installing or Upgrading PostgreSQL 9.4 on Ubuntu 14.04

time to read 1 min | 131 words

I am currently having a side project that requiring JSON Blob feature on PostgreSQL 9.4. But Ubuntu 14.04 only delivering PostgreSQL 9.3 on their repositories. Now I’ll posting step by step how to install or upgrade if you already using PostgreSQL 9.3 on ubuntu 14.04 to PostgreSQL 9.4.

Add PostgreSQL 9.4 repository and Import repository signing key, and update the package lists

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

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
  sudo apt-key add -

sudo apt-get update

Install PostgreSQL 9.4 and pgAdmin III

sudo apt-get install postgresql-9.4 pgadmin3

Check current clusters

pg_lsclusters

Stop PostgreSQL 9.4 cluster, drop it, and upgrade PostgreSQL 9.3 cluster to 9.4

sudo pg_dropcluster 9.4 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main

Confirm only 9.4 cluster remains

pg_lsclusters

Related Post:

  1. Jul 12, 2016 Fix Java Unsupported major.minor version 52.0 on Ubuntu
  2. Feb 03, 2016 Remove Entry from Known Host
  3. Jul 29, 2015 Fix Locale Settings Error On Ubuntu Server 14.04
  4. Apr 26, 2015 Installing Varnish with nginx on Ubuntu 14.04
  5. Apr 25, 2015 Disabling Apport Error Reporting on Ubuntu
  6. Feb 07, 2015 PostgreSQL 9.4 failed to start on Manjaro
  7. Jan 24, 2015 MariaDB error failed to start, errno 12