Ubuntu 12.04上的PostgreSQL 9.1 LTS - pg_ctl:无法启动服务器

sna*_*ies 4 ubuntu postgresql-9.1

更新2 - 我已经从root(即su)中卸载并重新安装了软件包,而不是使用我自己的帐户进行sudo.这允许从/ tmp运行可执行文件,从而消除了第一次更新时的错误.

更新 - 刚尝试卸载并重新安装(apt-get remove --purge postgresql,然后apt-get install postgresql postgresql-contrib postgresql-client)并得到此错误,我怀疑这与我的问题有关:*

Can't exec "/tmp/postgresql-common.config.32601": Permission denied at  /usr/share/perl/5.14/IPC/Open3.pm line 186.
open2: exec of /tmp/postgresql-common.config.32601 configure  failed at /usr/share/perl5/Debconf/ConfModule.pm line 59
Run Code Online (Sandbox Code Playgroud)

我无法启动postgreSQL,并希望得到一些帮助.

我已经研究了以下帖子的答案和评论 - 并尝试了pg_dropcluster和pg_createcluster - 但是没有运气配置postgreSQL 9.1以便在Ubuntu 12.04上启动.(但我能够在Windows上设置和配置postgreSQL没有问题.)

Postgresql无法启动

- 我应该注意这里给出的答案似乎有帮助,但由于我是Linux新手,我无法遵循它.我也想知道是否有更简单的方法.OP也没有接受答案,所以我不确定这是否真的解决了这个问题.

Postgresql在ubuntu中更改数据目录

我怀疑OP有与我所遇到的完全相同的问题,因为我收到了相同的错误消息,并且尽管终端中出现错误消息,但也没有日志文件输出.

pg_ctl: could not start server

Examine the log output.

PostgreSQL 9.1 did not start in a timely fashion, please see opt/PostgreSQL/9.1/data/pg_log/startup.log for details
Run Code Online (Sandbox Code Playgroud)

sna*_*ies 6

在网络上的所有教程中,这是最终为我工作的那个.

http://codingforme.wordpress.com/2012/05/15/installing-postgresql-database-and-pgadmin-iii-in-ubuntu-12-04/

我做了一个"pg_dropcluster 9.1 main",然后是"pg_createcluster 9.1 main start",然后完全跟着它.

主要区别在于其他教程无法在postgresql中创建用户,而只是在unix中创建用户.也许这是由于版本差异造成的.我再次使用postgresql 9.1.5,我在ubuntu 12.04上.

另外......别忘了apt-get install libpq-dev

希望在我的情况下这有助于其他任何人.