尝试在 Ubuntu 12.10 中为 pg 8.4 安装 postgresql-contrib

尝试在 Ubuntu 12.10 中为 pg 8.4 安装 postgresql-contrib

去年某个时候,我不得不做一些奇怪的巫术,才能在相对较新的 ubuntu 操作系统上安装 postgresql 8.4。我不得不使用 8.4,因为生产站点是 8.4,我们需要确保测试环境中的兼容性。(我们无法控制生产环境)

现在我正尝试在 db 中生成 uuid,但是 quantal 的 contrib 包需要 9.1。

有人知道我如何在不更新 postgres 服务器的情况下做到这一点吗?

~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.10
Release:        12.10
Codename:       quantal

PostgreSQL 8.4.11 在 i686-pc-linux-gnu 上,由 GCC gcc-4.6.real (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 编译,32 位

答案1

Ubuntu 12.04 LTS (Precise) 提供了适用于 PostgreSQL 8.4 的软件包。并非全部软件包,但足以包含 contrib:

dbuser@tratti:~$ apt-cache search postgresql|sort|grep 8.4                    
postgresql-8.4 - object-relational SQL database, version 8.4 server
postgresql-client-8.4 - front-end programs for PostgreSQL 8.4
postgresql-contrib-8.4 - additional facilities for PostgreSQL
postgresql-doc-8.4 - documentation for the PostgreSQL database management system
postgresql-plperl-8.4 - PL/Perl procedural language for PostgreSQL 8.4
postgresql-plpython-8.4 - PL/Python procedural language for PostgreSQL 8.4
postgresql-pltcl-8.4 - PL/Tcl procedural language for PostgreSQL 8.4
postgresql-server-dev-8.4 - development files for PostgreSQL 8.4 server-side programming

现在,由于您使用的是没有长期支持的 Ubuntu 12.10,因此它不包含 PostgreSQL 8.4 的软件包(这些软件包正是人们认为适合长期支持的软件包)。

但是,12.10 上没有 postgresql-8.4-* 冲突的软件包。这意味着您可以手动下载所需的 PostgreSQL 8.4 软件包并使用 进行安装dpkg -i。您可以从中找到所需的软件包,包括 contribUbuntu Precise 软件包列表页面

不过,可能你也会下载一些依赖项,因此你可以尝试(先在测试机上执行此操作,很可能会破坏某些东西):a) 只需放入 12.04 存储库,b) 运行apt-get update,c) 仅安装您需要的软件包,d) 然后删除 12.04 存储库,e) 最后apt-get update再次运行以删除可能存在的任何剩余内容。

这里要吸取的教训可能是,永远不要在与所谓的“生产”有一点点关系的任何东西上使用除 Ubuntu 长期版本之外的任何东西。如果您首先运行 12.04 LTS,那么您将完全摆脱这个问题。

相关内容