我跑去do-release-upgrade
将Ubuntu 12.04服务器更新为Ubuntu 14.04。它似乎运行顺利,但是当我apt-get update
在升级后这样做时,我注意到PostgreSQL软件包仍在寻找精确的存储库,而不是可信赖的存储库。我按照此处的说明添加了可信赖的存储库,并将.list
包含精确存储库的文件移至临时目录作为备份。完成此操作后,它sudo apt-get upgrade
失败了,即使恢复了精确的设置后,我也无法使其再次完全运行回购。我没有碰到错误消息。由于这是开发服务器,并且所有数据都不是必需的,因此我决定仅重新安装PostgreSQL。在尝试清除我认为可能会干扰的服务器上的任何自定义配置后,此操作反复失败。我能够sudo apt-get install postgresql-common
成功完成操作,但是如果尝试sudo apt-get install postgresql-9.5
执行以下操作,将失败:
Setting up postgresql-9.5 (9.5.5-1.pgdg14.04+1) ...
Creating new cluster 9.5/main ...
config /etc/postgresql/9.5/main
data /var/lib/postgresql/9.5/main
locale en_US.UTF-8
socket /var/run/postgresql
port 5432
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.5-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
Setting up sysstat (10.2.0-1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
update-alternatives: using /usr/bin/sar.sysstat to provide /usr/bin/sar (sar) in auto mode
Processing triggers for libc-bin (2.19-0ubuntu6.9) ...
Errors were encountered while processing:
postgresql-9.5
postgresql-contrib-9.5
E: Sub-process /usr/bin/dpkg returned an error code (1)
Jan 17 15:31:31 beta kernel: [ 4.029504] systemd-journald[543]: Failed to resolve 'systemd-journal' group: No such process
如果我尝试systemctl status [email protected]
得到:
[email protected]
Loaded: error (Reason: No such file or directory)
Active: inactive (dead)
该/var/log/postgresql/postgresql-9.5-main.log
日志文件是空的,所以我不知道还有什么地方检查日志。安装失败后,请按照此处的步骤进行完全卸载。我无法确定这是PostgreSQL还是升级服务器的问题。
更新:的输出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.5-1.pgdg14.04+1 amd64 object-relational SQL database, version 9.5 server
un postgresql-client <none> <none> (no description available)
ii postgresql-client-9.5 9.5.5-1.pgdg14.04+1 amd64 front-end programs for PostgreSQL 9.5
ii postgresql-client-common 178.pgdg14.04+1 all manager for multiple PostgreSQL client versions
ii postgresql-common 178.pgdg14.04+1 all PostgreSQL database-cluster manager
iU postgresql-contrib-9.5 9.5.5-1.pgdg14.04+1 amd64 additional facilities for PostgreSQL
un postgresql-doc-9.5 <none> <none> (no description available)
我遇到了同样的问题,将Ubuntu 12.04升级到14.04。不知道,但它也使用systemd。在检查/etc/init.d/postgresql
文件时,它使用/usr/share/postgresql-common/init.d-functions
。
该文件执行/ usr / bin / pg_ctlcluster来启动和停止postgresql服务器。
if [ "$1" = "stop" ] || [ "$1" = "restart" ]; then
ERRMSG=$(pg_ctlcluster --force "$2" "$name" $1 2>&1)
else
ERRMSG=$(pg_ctlcluster "$2" "$name" $1 2>&1)
fi
/usr/bin/pg_ctlcluster
文件接受--skip-systemctl-redirect
选项来启动或停止不带systectl的postgresql。
所以,你需要添加--skip-systemctl-redirect
在/usr/share/postgresql-common/init.d-functions
在do_ctl_all()函数。因此它将看起来像这样。
if [ "$1" = "stop" ] || [ "$1" = "restart" ]; then
ERRMSG=$(pg_ctlcluster --skip-systemctl-redirect --force "$2" "$name" $1 2>&1)
else
ERRMSG=$(pg_ctlcluster --skip-systemctl-redirect "$2" "$name" $1 2>&1)
fi
或者您可以$skip_systemctl_redirect = 1;
在$skip_systemctl_redirect
检入之前添加/usr/bin/pg_ctlcluster
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句