我搜索了一下,但没有找到安装错误的答案:

$ sudo aptitude install postgresql-9.1 postgresql-contrib-9.1 python-pygresql libpq-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initialising package states... Done
The following NEW packages will be installed:
  libossp-uuid16{a} postgresql-9.1 postgresql-common{a} postgresql-contrib-9.1 python-pygresql
0 packages upgraded, 5 newly installed, 0 to remove and 32 not upgraded.
Need to get 0B/7,463kB of archives. After unpacking 21.2MB will be used.
Do you want to continue? [Y/n/?] Y
Writing extended state information... Done
Preconfiguring packages ...
Selecting previously deselected package libossp-uuid16.
(Reading database ... 414497 files and directories currently installed.)
Unpacking libossp-uuid16 (from .../libossp-uuid16_1.6.2-1ubuntu1_amd64.deb) ...
Selecting previously deselected package postgresql-common.
Unpacking postgresql-common (from .../postgresql-common_133~lucid_all.deb) ...
Adding `diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
Selecting previously deselected package postgresql-9.1.
Unpacking postgresql-9.1 (from .../postgresql-9.1_9.1.4-1~lucid4_amd64.deb) ...
Selecting previously deselected package postgresql-contrib-9.1.
Unpacking postgresql-contrib-9.1 (from .../postgresql-contrib-9.1_9.1.4-1~lucid4_amd64.deb) ...
Selecting previously deselected package python-pygresql.
Unpacking python-pygresql (from .../python-pygresql_1%3a4.0-2_amd64.deb) ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Setting up libossp-uuid16 (1.6.2-1ubuntu1) ...

Setting up postgresql-common (133~lucid) ...
"IN6ADDR_ANY" is not exported by the Socket module
Can't continue after import errors at /usr/share/postgresql-common/PgCommon.pm line 19
BEGIN failed--compilation aborted at /usr/share/postgresql-common/PgCommon.pm line 19.
Compilation failed in require at /usr/share/postgresql-common/run-upgrade-scripts line 18.
BEGIN failed--compilation aborted at /usr/share/postgresql-common/run-upgrade-scripts line 18.
"IN6ADDR_ANY" is not exported by the Socket module
Can't continue after import errors at /usr/share/postgresql-common/PgCommon.pm line 19
BEGIN failed--compilation aborted at /usr/share/postgresql-common/PgCommon.pm line 19.
Compilation failed in require at /usr/share/postgresql-common/pg_checksystem line 20.
BEGIN failed--compilation aborted at /usr/share/postgresql-common/pg_checksystem line 20.

Setting up postgresql-9.1 (9.1.4-1~lucid4) ...
**"IN6ADDR_ANY" is not exported by the Socket module
Can't continue after import errors at /usr/share/postgresql-common/PgCommon.pm line 19
BEGIN failed--compilation aborted at /usr/share/postgresql-common/PgCommon.pm line 19.
Compilation failed in require at /usr/bin/pg_createcluster line 19.
BEGIN failed--compilation aborted at /usr/bin/pg_createcluster line 19.
Error: could not create default cluster. Please create it manually with

  pg_createcluster 9.1 main --start

or a similar command (see 'man pg_createcluster').**
update-alternatives: using /usr/share/postgresql/9.1/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode.

Setting up postgresql-contrib-9.1 (9.1.4-1~lucid4) ...

Setting up python-pygresql (1:4.0-2) ...

Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Processing triggers for python-central ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initialising package states... Done
Writing extended state information... Done

我不知道6Addr中有什么,也不知道如何将其设置为通过Socket模块导出。
在sudo add apt repository ppa:pitti/postgresql之后,我试图在ubuntu 10.04上安装它

最佳答案

问题是套接字模块没有更新,旧版本的套接字在6addr_ANY中不导出。(见/usr/lib/perl/5.12.4/Socket.pm)。我的机器上的版本是1.87_01,并且该版本不在6addr_ANY中导出。最新版本是2.002。
问题可能是有人在打包新的postgresql-9.1dpkg时忘记输入Socket 2.002作为依赖项。
修复方法是更新套接字模块:

$ sudo apt-get install libsocket-perl

如果这对您不起作用,请尝试通过cpan升级Socket:
$ sudo apt-get install cpan
$ sudo cpan Socket

编辑:
如果Socket无法通过上面的命令安装,并且正在弹出消息“BEGIN failed--compilation aborted at Makefile.PL line 6”,请运行:
$ sudo cpan ExtUtils::Constant

这将获得更新套接字所必需的ExtUtils::Constant v0.23。然后您应该能够运行:
$ sudo cpan Socket

没有问题。

10-07 19:22
查看更多