Ubuntu 17.04 - 17.10
Version 9.6 comes with the distribution.
sudo apt-get install postgresql-9.6
Ubuntu 14.04, 16.04
sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main"
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql-9.6
install posgres-9.6
sudo add-apt-repository “deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -sc)-pgdg main”
wget — quiet -O — https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql-client-9.6
install psql without posgres