如何在 Ubuntu 14.10 中安裝 Postgresql 9.3 而不是預設的 9.4?

如何在 Ubuntu 14.10 中安裝 Postgresql 9.3 而不是預設的 9.4?

我在 Utopic Unicorn,需要安裝 Postgresql 9.3 伺服器和客戶端。當我嘗試自動完成時sudo apt-get install postgres,我只看到 9.4 包:

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-dev

我如何安裝他們的9.3版本?

答案1

新增官方 postgres PPA / Apt 儲存庫。它具有所有受支援版本的軟體包。

看:http://www.postgresql.org/download/linux/ubuntu/

  • 建立文件/etc/apt/sources.list.d/pgdg.list,並為儲存庫新增一行
    • deb http://apt.postgresql.org/pub/repos/apt/ utopic-pgdg main
  • 導入儲存庫簽署金鑰,並更新套件列表
    • wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \ sudo apt-key add -
    • sudo apt-get update

答案2

來自PostgreSQL 下載頁面:

如果您的 Ubuntu 版本中包含的版本不是您想要的版本,您可以使用 PostgreSQL Apt 儲存庫。該儲存庫將與您的常規系統和修補程式管理集成,並在 PostgreSQL 的整個支援生命週期內為所有受支援的 PostgreSQL 版本提供自動更新。

PostgreSQL apt 儲存庫支援 amd64 和 i386 架構上的 Ubuntu 10.04 和 12.04 LTS 版本。雖然不完全支持,但這些軟體包通常也可以透過使用最接近的可用 LTS 版本在非 LTS 版本上運行。

新增 PostgreSQL 儲存庫:

sudo tee /etc/apt/sources.list.d/pgdg.list <<EOF
deb http://apt.postgresql.org/pub/repos/apt/ utopic-pgdg main
EOF
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update

(是的,不管它怎麼說,看起來他們確實支持 14.10。)

相關內容