安装 postgresql 时出错(安装的子进程安装后脚本返回错误退出状态 64)

安装 postgresql 时出错(安装的子进程安装后脚本返回错误退出状态 64)

尝试安装 postgresql 时出现错误。我将在下面解释我发现的问题,但以下是完整输出:

sudo apt-get install postgresql postgresql-contrib
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  postgresql-9.4 postgresql-common postgresql-contrib-9.4
Suggested packages:
  postgresql-doc oidentd ident-server locales-all libdbd-pg-perl
The following NEW packages will be installed:
  postgresql postgresql-9.4 postgresql-common postgresql-contrib
  postgresql-contrib-9.4
0 upgraded, 5 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/4,436 kB of archives.
After this operation, 21.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Preconfiguring packages ...
Selecting previously unselected package postgresql-common.
(Reading database ... 408486 files and directories currently installed.)
Preparing to unpack .../postgresql-common_169.pgdg14.04+1_all.deb ...
Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
Unpacking postgresql-common (169.pgdg14.04+1) ...
Selecting previously unselected package postgresql-9.4.
Preparing to unpack .../postgresql-9.4_9.4.4-1.pgdg14.04+1_amd64.deb ...
Unpacking postgresql-9.4 (9.4.4-1.pgdg14.04+1) ...
Selecting previously unselected package postgresql.
Preparing to unpack .../postgresql_9.4+169.pgdg14.04+1_all.deb ...
Unpacking postgresql (9.4+169.pgdg14.04+1) ...
Selecting previously unselected package postgresql-contrib-9.4.
Preparing to unpack .../postgresql-contrib-9.4_9.4.4-1.pgdg14.04+1_amd64.deb ...
Unpacking postgresql-contrib-9.4 (9.4.4-1.pgdg14.04+1) ...
Selecting previously unselected package postgresql-contrib.
Preparing to unpack .../postgresql-contrib_9.4+169.pgdg14.04+1_all.deb ...
Unpacking postgresql-contrib (9.4+169.pgdg14.04+1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up postgresql-common (169.pgdg14.04+1) ...
Illegal option -d
Usage: install [<option>...] [<path>]
Install exercism client to <path>. Default:
  * determined interactively if possible
  * /usr/local/bin if run as root
  * /usr/local/bin if it is writable
  * /home/collin/bin otherwise
Options:
  -v <version>           Install client version <version>.      Default: v2.2.0
  -o <operating system>  Install client for <operating system>. Default: linux
  -a <architecture>      Install client for <architecture>.     Default: 64bit
dpkg: error processing package postgresql-common (--configure):
 subprocess installed post-installation script returned error exit status 64
dpkg: dependency problems prevent configuration of postgresql-9.4:
 postgresql-9.4 depends on postgresql-common (>= 142~); however:
  Package postgresql-common is not configured yet.

dpkg: error processing package postgresql-9.4 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql:
 postgresql depends on postgresql-9.4; however:
  Package postgresql-9.4 is not configured yet.

dpkg: error processing package postgresql (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib-9.4:
 postgresql-contrib-9.4 depends on postgresql-9.4 (= 9.4.4-1.pgdg14.04+1); however:
  Package postgresql-9.4 is not configured yet.

dpkg: error processing package postgresql-contrib-9.4 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib:
 postgresql-contrib depends on postgresql-contrib-9.4; however:No apport report written because the error message indicates its a followup error from a previous failure.
                                                 No apport report written because the error message indicates its a followup error from a previous failure.
                                   No apport report written because MaxReports is reached already
                                                                                                 No apport report written because MaxReports is reached already

  Package postgresql-contrib-9.4 is not configured yet.

dpkg: error processing package postgresql-contrib (--configure):
 dependency problems - leaving unconfigured
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
 postgresql-common
 postgresql-9.4
 postgresql
 postgresql-contrib-9.4
 postgresql-contrib
E: Sub-process /usr/bin/dpkg returned an error code (1)

看起来它无法安装 postgresql-common,这会导致它在尝试安装其他 postgresql 包时引用的所有“依赖性问题”。在安装 postgresql-common 出错之前,它发出以下错误:

Setting up postgresql-common (169.pgdg14.04+1) ...
Illegal option -d
Usage: install [<option>...] [<path>]
Install exercism client to <path>. Default:
  * determined interactively if possible
  * /usr/local/bin if run as root
  * /usr/local/bin if it is writable
  * /home/collin/bin otherwise
Options:
  -v <version>           Install client version <version>.      Default: v2.2.0
  -o <operating system>  Install client for <operating system>. Default: linux
  -a <architecture>      Install client for <architecture>.     Default: 64bit

我认为这是指exercism.io我之前安装的客户端。奇怪的是,当我尝试运行service postgresql start(如建议的那样这里),它吐出了同样的错误。在我清除所有 postgresql 包后,当我尝试时service postgresql start,它只是说postgresql: unrecognized service

所有这些都让我认为 exercism 客户端与问题有关。我对 Ubuntu 没什么经验,所以我不知道该怎么做,我可能错了。我尝试删除对 exercism 的所有引用,包括我的 $HOME/bin 中的 exercism 文件,以及放置在我的 bash 配置文件中的 $PATH 的相应添加。这样做根本没有改变我的结果。exercism 网站似乎没有关于卸载客户端的任何支持,所以我不知道是否还有其他我应该做的事情。任何意见都将不胜感激。

PS 我做了一些基本的事情,比如清理我的软件包,卸载 postgresql 软件包,重启电脑,然后尝试重新安装它们(详情如下)这里这里),但并无效果。

编辑:的输出sudo which install/usr/local/bin/install

答案1

显然,您已将installexercism.io 命令下载或安装到 中/usr/local/bin。请将其移动到不在您的 $PATH 中的另一个位置,或者如果不再需要它,请将其删除。

相关内容