I want to install PostgreSQL 9.5. But the available version is 9.6.

I only need 9.5 to build wal2json against it and test it (requirement because of AWS version).

  • How exactly did you determine the PostgreSQL version after installation of postgresql-9.6? Is it possible that you have another installation of PostgreSQL set up on your system in a way that takes precedence over the former? – David Foerster Jul 14 '18 at 11:41
  • Doh! You are right. I had few docker containers running and one was at 5432. However, still, I need 9.5 and the package available is 9.6. I have changed the question accordingly. Thanks. – Ondra Žižka Jul 15 '18 at 1:14
  • Note for whoever compiles against PostgreSQL: Make sure you have the right postgresql-dev-<version> package installed, and not postgresql-dev-all. Also check pg_config output. – Ondra Žižka Jul 16 '18 at 1:51

The last supported release that includes postgresql-9.5 in its default repositories is Ubuntu 16.04. Manually download the following two files from the official Ubuntu website:

The two .deb files have been updated to postgresql-client-9.5_9.5.14-0ubuntu0.16.04_amd64.deb and postgresql-9.5_9.5.14-0ubuntu0.16.04_amd64.deb.

Change directories using cd to the directory containing the two .deb files that you downloaded. Run the following commands:

sudo apt install libedit2 libpq5 libssl1.0.0 postgresql-client-common zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 postgresql-common locales ssl-cert tzdata sysstat 
sudo dpkg -i postgresql-client-9.5_9.5.12-0ubuntu0.16.04_amd64.deb postgresql-9.5_9.5.12-0ubuntu0.16.04_amd64.deb

Current versions of postgresql-all:

Ubuntu postgresql-all   
18.04   10     
19.10   11     
20.04   12     
20.10   12  
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.