我有一台 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
一个好主意,还是通常会安装比实际需要多得多的东西?
答案1
根据 PostgresSQL 的安装要求,它只需要 GNU make、GCC 或类似软件、、tar
GNU Readline 和zlib
。不过,根据您的构建选项,还有许多其他可选依赖项,例如 Perl 和 Python。
如果您不需要任何可选功能,您当然可以将其关闭;您只是无法在构建时选择它们。build-dep
正在尝试解决 Ubuntu 软件包维护者构建软件包的方式的所有依赖关系,其中可能包括许多构建选项,以便尽可能多的人可以使用它。