How to install Postgresql 9.3 instead of default 9.4 in Ubuntu 14.10?
Matthew Barrera
I'm on Utopic Unicorn and I need to install Postgresql 9.3 server and client.
When I try to autocomplete sudo apt-get install postgres, I see only 9.4 packages:
postgresql postgresql-autodoc
postgresql-9.4 postgresql-client
postgresql-9.4-asn1oid postgresql-client-9.4
postgresql-9.4-dbg postgresql-client-common
postgresql-9.4-debversion postgresql-common
postgresql-9.4-ip4r postgresql-comparator
postgresql-9.4-orafce postgresql-contrib
postgresql-9.4-pgespresso postgresql-contrib-9.4
postgresql-9.4-pgextwlist postgresql-doc
postgresql-9.4-pgfincore postgresql-doc-9.4
postgresql-9.4-pgmemcache postgresql-filedump
postgresql-9.4-pgmp postgresql-hll
postgresql-9.4-pgpool2 postgresql-plperl-9.4
postgresql-9.4-pgq3 postgresql-plpython3-9.4
postgresql-9.4-pgrouting postgresql-plpython-9.4
postgresql-9.4-pgrouting-doc postgresql-pltcl-9.4
postgresql-9.4-pllua postgresql-prioritize
postgresql-9.4-plproxy postgresql-server-dev-9.4
postgresql-9.4-plr postgresql-server-dev-all
postgresql-9.4-plsh postgres-xc
postgresql-9.4-plv8 postgres-xc-client
postgresql-9.4-postgis-2.1 postgres-xc-contrib
postgresql-9.4-postgis-2.1-scripts postgres-xc-dbg
postgresql-9.4-postgis-scripts postgres-xc-doc
postgresql-9.4-prefix postgres-xc-plperl
postgresql-9.4-preprepare postgres-xc-plpython
postgresql-9.4-repmgr postgres-xc-pltcl
postgresql-9.4-slony1-2 postgres-xc-server-devHow can I install their 9.3 versions?
2 Answers
Add the official postgres PPA / Apt repo. It has packages for all of the supported versions.
See:
- Create the file
/etc/apt/sources.list.d/pgdg.list, and add a line for the repositorydeb utopic-pgdg main
- Import the repository signing key, and update the package lists
wget --quiet -O - | \ sudo apt-key add -sudo apt-get update
From the PostgreSQL downloads page:
If the version included in your version of Ubuntu is not the one you want, you can use the PostgreSQL Apt Repository. This repository will integrate with your normal systems and patch management, and provide automatic updates for all supported versions of PostgreSQL throughout the support lifetime of PostgreSQL.
The PostgreSQL apt repository supports LTS versions of Ubuntu, 10.04 and 12.04, on amd64 and i386 architectures. While not fully supported, the packages often work on non-LTS versions as well, by using the closest LTS version available.
To add the PostgreSQL repository:
sudo tee /etc/apt/sources.list.d/pgdg.list <<EOF
deb utopic-pgdg main
EOF
wget --quiet -O - | sudo apt-key add -
sudo apt-get update(Yes, despite what it says it looks like they do support 14.10.)