How do I install/update to Postgres 9.4?

speg picture speg · Dec 26, 2014 · Viewed 27.7k times · Source

I just installeed Postgres, but it seems to have installed 9.3 and I'd like to start with 9.4

I simply did apt-get install postgresql from a new Ubuntu 14.04.1 machine.

http://www.postgresql.org/download/linux/ubuntu/

says you can do:

apt-get install postgresql-9.4

but when I try that I get:

E: Couldn't find any package by regex 'postgresql-9.4

Okay, so I try the section below where you add the PostgreSQL Apt Repository but that can't find anything either.

Is 9.4 not in the package managers yet? Am I doing something horribly wrong?

Answer

user924069 picture user924069 · Apr 2, 2015

You can add it from the instructions in the page

http://www.postgresql.org/download/linux/ubuntu/

  • Create the file /etc/apt/sources.list.d/pgdg.list, and add a line for the repository

    deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main
    
  • Import the repository signing key, and update the package lists

    wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
    sudo apt-get update && sudo apt-get install postgresql-9.4