dpkg:处理包 postgresql-contrib-9.5 时出错(--configure) - postgresql

dpkg:处理包 postgresql-contrib-9.5 时出错(--configure) - postgresql

我需要重新安装postgresqlubuntu14.04安装 9.5 版本后,postgreql我遇到了这个错误,另外我尝试过谷歌搜索一些解决方案,但我无法解决问题,而且我的postgresql-9.5-main.log是空的,那是一些奇怪的东西。

因此错误如下:

Ver Cluster Port Status Owner    Data directory               Log file
9.5 main    5432 down   postgres /var/lib/postgresql/9.5/main /var/log/postgresql/postgresql-9.5-main.log
update-alternatives: using /usr/share/postgresql/9.5/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
 * Starting PostgreSQL 9.5 database server                                                                               * Failed to issue method call: Unit [email protected] failed to load: No such file or directory. See system logs and 'systemctl status [email protected]' for details.
                                                                                                                 [fail]
invoke-rc.d: initscript postgresql, action "start" failed.
dpkg: error processing package postgresql-9.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of postgresql-contrib-9.5:
 postgresql-contrib-9.5 depends on postgresql-9.5 (= 9.5.7-1.pgdg14.04+1); however:
  Package postgresql-9.5 is not configured yet.

dpkg: error processing package postgresql-contrib-9.5 (--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.5
 postgresql-contrib-9.5
E: Sub-process /usr/bin/dpkg returned an error code (1)

除此之外,当我尝试连接时,psql出现了另一个错误:

psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

当我想用创建新数据库时也会发生这种情况createdb example,因此我尝试了此解决方案所以回答,但错误仍然存​​在。

这是来自dpkg -l "postgresql*"

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                     Version           Architecture      Description
+++-========================-=================-=================-=====================================================
un  postgresql-7.4           <none>            <none>            (no description available)
un  postgresql-8.0           <none>            <none>            (no description available)
un  postgresql-9.1           <none>            <none>            (no description available)
iF  postgresql-9.5           9.5.7-1.pgdg14.04 amd64             object-relational SQL database, version 9.5 server
un  postgresql-client        <none>            <none>            (no description available)
ii  postgresql-client-9.5    9.5.7-1.pgdg14.04 amd64             front-end programs for PostgreSQL 9.5
ii  postgresql-client-common 182.pgdg14.04+1   all               manager for multiple PostgreSQL client versions
ii  postgresql-common        182.pgdg14.04+1   all               PostgreSQL database-cluster manager
un  postgresql-contrib       <none>            <none>            (no description available)
iU  postgresql-contrib-9.5   9.5.7-1.pgdg14.04 amd64             additional facilities for PostgreSQL
un  postgresql-doc-9.5       <none>            <none>            (no description available)
un  postgresql-doc-9.6       <none>            <none>            (no description available)

所以谁能向我解释一下这里发生了什么,以及如何解决这个问题,谢谢。

相关内容