??
Add PostgreSQL apt repo. According to your distribution (Utopic, trusty, Jessie, wheezy and etc):
??
Deb HTTP://APT.POSTGRESQL.ORG/PUB/REPOS/APT/TRUSTY-PGDG main 9.5
??
Install PostgreSQL 9.5
wget--quiet-o-HTTPS://WWW.POSTGRESQL.ORG/MEDIA/KEYS/ACCC4CF8.ASC | sudo apt-key add-
Apt-get Update
Apt-get Install postgresql-9.5
??
??
Upgrade db files.
??
Pg9.3 to pg9.5, run the following command
??
Sudo-h-U postgres
/usr/lib/postgresql/9.5/bin/pg_upgrade-b/usr/lib/postgresql/9.3/bin/
-b/usr/lib/postgresql/9.5/bin/
-d/var/lib/postgresql/9.3/main
-d/var/lib/postgresql/9.5/main
-O '-C config_file=/etc/postgresql/9.3/main/postgresql.conf '
-O '-C config_file=/etc/postgresql/9.5/main/postgresql.conf '
??
??
??
Pg9.1 to pg9.5, run the following command
??
Sudo-h-U postgres
/usr/lib/postgresql/9.5/bin/pg_upgrade-b/usr/lib/postgresql/9.1/bin/
-b/usr/lib/postgresql/9.5/bin/
-d/var/lib/postgresql/9.1/main
-d/var/lib/postgresql/9.5/main
-O '-C config_file=/etc/postgresql/9.1/main/postgresql.conf '
-O '-C config_file=/etc/postgresql/9.5/main/postgresql.conf '
??
??
??
??
??
Upgrade to PostgreSQL 9.5