How install postgresql 9.4
This command installs the recent version for your distribution:
sudo apt-get install postgresql
postgresql-9.4
is available since Utopic.
Source
Here is a step by step guide to install Postgesql 9.4 for your Ubuntu (Utopic, Trusty, Precise, Lucid) version.
sudo add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt YOUR_UBUNTU_VERSION_HERE-pgdg main"
For trusty:
sudo add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main"
To get your ubuntu version:
lsb_release -sc
Now import the public key and install:
wget --quiet -O - https://postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.4
Use the following commands (the command is capable of getting your Ubuntu version, No need of manual change):
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-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
sudo apt-get install postgresql-9.4 pgadmin3
Source: How to Install PostgreSQL 9.4 in Ubuntu / Linux Mint
You can install it by running
sudo apt-get install postgresql
Version 9.3 will be installed for 14.04, 9.4 for 14.10 and 15.04.
If you need 9.4 with Ubuntu 14.04, you can install it as described at postgresql site