我有一个 Ubuntu 12.04.2 服务器,我想安装 Postgres 9.2.4。如果我想构建所有依赖项,我无法使用apt-get build-dep
(至少没有一些花招),因为只有 9.1 可用于apt-get install
. 这让我陷入了“我想知道自 9.1 以来添加了哪些新依赖项”的困境。所以,我决定无论如何都要检查 Postgres 9.1 的依赖项,所以我做了一个试运行:
me@my-server:~$ sudo apt-get build-dep postgresql-9.1 --dry-run
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
bison comerr-dev debhelper dh-apparmor docbook docbook-dsssl docbook-xsl flex gettext html2text intltool-debian krb5-multidev libbison-dev libcroco3 libedit-dev libexpat1-dev libfl-dev libgettextpo0
libgssrpc4 libkadm5clnt-mit8 libkadm5srv-mit8 libkdb5-6 libkrb5-dev libldap2-dev libncurses5-dev libosp5 libossp-uuid-dev libossp-uuid16 libostyle1c2 libpam0g-dev libperl-dev libperl5.14 libpython3.2
libssl-dev libunistring0 libxml2-dev libxslt1-dev libxslt1.1 m4 openjade opensp po-debconf python-dev python2.7-dev python3 python3-dev python3-minimal python3.2 python3.2-dev python3.2-minimal
sgml-data tcl8.5 tcl8.5-dev xsltproc
0 upgraded, 54 newly installed, 0 to remove and 0 not upgraded.
... rest omitted
这告诉我有相当多的依赖项当前没有安装。因此,我决定检查Postgres 9.1 实际安装的空运行:
me@my-server:~$ sudo apt-get install postgresql-9.1 --dry-run
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libpq5 postgresql-client-9.1 postgresql-client-common postgresql-common ssl-cert
Suggested packages:
oidentd ident-server locales-all postgresql-doc-9.1 openssl-blacklist
The following NEW packages will be installed:
libpq5 postgresql-9.1 postgresql-client-9.1 postgresql-client-common postgresql-common ssl-cert
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
... rest omitted
现在,我的问题是因为如果我简单地apt-get install libreadline6-dev libghc-zlib-dev
(从我读过的教程),我就能很好地安装 Postgres 9.2.4。它似乎运行得很好,并且make check
通过了。所以,build-dep
在这种情况下通常是个好主意,还是它通常安装的数量比实际需要的多得多?
根据 PostgresSQL 的安装要求,它只需要 GNU make、GCC 或类似
tar
软件、GNU Readline 和zlib
. 不过,根据您的构建选项,还有许多其他可选依赖项,例如 Perl 和 Python。如果您不需要任何可选功能,您当然可以将它们关闭;您只是无法在构建时选择它们。
build-dep
正在尝试解决 Ubuntu 包维护者构建包的方式的所有依赖关系,其中可能包含许多构建选项,以便最广泛的人可以使用它。