每次我尝试安装软件包时,APT 都会尝试配置 PostgreSQL

Mit*_*ops 4 apt postgresql

我最近在尝试 apt-get 安装任何东西时都会遇到一些奇怪的错误。这是尝试安装fluidsynth的示例。

$ sudo apt-get install libfluidsynth1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libfluidsynth1 is already the newest version.
libfluidsynth1 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up postgresql-9.1 (9.1.10-0ubuntu12.04) ...
 * Starting PostgreSQL 9.1 database server                                                                                                                     * The PostgreSQL server failed to start. Please check the log output:
2013-11-03 14:21:42 EST FATAL:  could not access private key file "server.key": No such file or directory
                                                                                                                                                       [fail]
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing postgresql-9.1 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql:
 postgresql depends on postgresql-9.1; however:
  Package postgresql-9.1 is not configured yet.
dpkg: error processing postgresql (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 postgresql-9.1
 postgresql
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)

我正在运行 12.04。这是什么原因造成的,我该如何解决?它发生在安装很多东西时,似乎表明我需要初始化 postgresql 或其他东西。我不记得摆弄过 postgres,所以我不确定为什么这突然变得有问题。

Bra*_*iam 5

删除/清除postgresql-9.1并重新安装它们:

sudo apt-get --purge autoremove postgresql-9.1 postgresql
Run Code Online (Sandbox Code Playgroud)

如果你真的使用postgresql,或者其他包依赖它,你可以重新安装它

sudo apt-get install postgresql the-other-program-that-got-removed
Run Code Online (Sandbox Code Playgroud)

BTW,libfluidsynth1已经安装好了,不用再安装了。