Делаю всё как здесь описано: https://www.postgresql.org/download/linux/debian/
apt-get install postgresql-9.5 выдаёт в конце вот это:
Adding user postgres to group ssl-cert
Creating config file /etc/postgresql-common/createcluster.conf with new version
Creating config file /etc/logrotate.d/postgresql-common with new version
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
[warn] No PostgreSQL clusters exist; see "man pg_createcluster" ... (warning).
Setting up postgresql-9.5 (9.5.3-1.pgdg70+1) ...
Creating new cluster 9.5/main ...
config /etc/postgresql/9.5/main
data /var/lib/postgresql/9.5/main
locale en_US.UTF-8
/usr/lib/postgresql/9.5/bin/postgres: /usr/local/lib/libxml2.so.2: no version information available (required by /usr/lib/postgresql/9.5/bin/postgres)
/usr/lib/postgresql/9.5/bin/postgres: /usr/local/lib/libxml2.so.2: no version information available (required by /usr/lib/postgresql/9.5/bin/postgres)
/usr/lib/postgresql/9.5/bin/postgres: symbol lookup error: /usr/lib/postgresql/9.5/bin/postgres: undefined symbol: __xmlStructuredErrorContext
no data was returned by command ""/usr/lib/postgresql/9.5/bin/postgres" -V"
The program "postgres" is needed by initdb but was not found in the
same directory as "/usr/lib/postgresql/9.5/bin/initdb".
Check your installation.
Error: initdb failed
Error: could not create default cluster. Please create it manually with
pg_createcluster 9.5 main --start
or a similar command (see 'man pg_createcluster').
update-alternatives: using /usr/share/postgresql/9.5/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
[warn] No PostgreSQL clusters exist; see "man pg_createcluster" ... (warning).
Setting up postgresql-contrib-9.5 (9.5.3-1.pgdg70+1) ...
Setting up sysstat (10.0.5-1) ...
Creating config file /etc/default/sysstat with new version
update-alternatives: using /usr/bin/sar.sysstat to provide /usr/bin/sar (sar) in auto mode
Ну и `pg_createcluster 9.5 main --start` тоже самое примерно.