Postgres-xc 不会卸载(停止协调器失败)

Mar*_*hot 7 apt postgresql

我在做一些 Rails 开发时不小心安装了 postres-xc 而不是普通的 postgres 包。我立即去删除 postgres-xc,但 apt-get 不会卸载它。我也尝试安装常规的 postgres,但它以同样的方式失败。

sudo apt-get 删除 postgres-xc 输出:

  Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  comerr-dev krb5-multidev libgraphics-magick-perl libgraphicsmagick++1-dev libgraphicsmagick++3 libgraphicsmagick1-dev libgraphicsmagick3 libgssrpc4 libkadm5clnt-mit8 libkadm5srv-mit8
  libkdb5-6 libkrb5-dev libpq-dev libpq5 libssl-dev libssl-doc linux-headers-3.5.0-17
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  postgres-xc
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 17.1 MB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 217256 files and directories currently installed.)
Removing postgres-xc ...
 * Stopping Postgres-XC datanodes                                                                                                                                                  [ OK ] 
 * Stopping Postgres-XC coordinators                                                                                                                                               [fail] 
invoke-rc.d: initscript postgres-xc, action "stop" failed.
dpkg: error processing postgres-xc (--remove):
 subprocess installed pre-removal script returned error exit status 1
 * Starting Postgres-XC global transaction management daemons                                                                                                                      [ OK ] 
 * Starting Postgres-XC coordinators                                                                                                                                               [ OK ] 
 * Starting Postgres-XC datanodes                                                                                                                                                  [ OK ] 
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 postgres-xc
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)

编辑

我发现它至少部分卸载了,因为如果不使用 apt-get -f install 修复它,我就无法安装任何其他东西。

似乎也是一个已知问题

Postgres-xc 不会卸载(停止协调器失败) https://bugs.launchpad.net/ubuntu/+source/postgres-xc/+bug/1084849

无论如何我可以手动将其从我的安装中删除。

编辑 2

修复。解决方案是 dpkg --purge postgres-xc

Kev*_*cht 8

对我有用的解决方案是:

  1. 修改 postgres-xc.prerm:

    须藤 vim /var/lib/dpkg/info/postgres-xc.prerm

    在第一行之后添加“exit 0” (#/bin/sh -e)

  2. 然后正常删除:

    sudo apt-get 删除 postgres-xc

(我在以下位置找到了这个解决方案:https : //bugs.launchpad.net/ubuntu/+source/postgres-xc/+bug/1084849