How to install PostgreSQL 9.5 in Ubuntu 18.04?
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:
- postgresql-client-9.5_9.5.12-0ubuntu0.16.04_amd64.deb
- postgresql-9.5_9.5.12-0ubuntu0.16.04_amd64.deb
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 apt install ./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 21.04 13 21.10 13 22.04 13
Related videos on Youtube
Ondra Žižka
I am. (See my LinkedIn profile. Open to job offers for USA, Germany, Austria, Switzerland). 2012 update: I'm a company-man, a team-player, a paradigm-shifter and a core-competancy-synergizer. :) PS: I worked for Red Hat / JBoss, so my answers may be biased. Currently work for Swiss Re.
Updated on September 18, 2022Comments
-
Ondra Žižka almost 2 years
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).-
David Foerster almost 6 yearsHow 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? -
Ondra Žižka almost 6 yearsDoh! 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 almost 6 yearsNote for whoever compiles against PostgreSQL: Make sure you have the right
postgresql-dev-<version>
package installed, and notpostgresql-dev-all
. Also checkpg_config
output.
-
-
lacostenycoder over 3 yearsThis didn't seem to work for me