【发布时间】:2018-10-03 15:07:49
【问题描述】:
我在我的 Debian 虚拟机上按照 PostgreSQL 安装指南中的步骤进行操作,但是当我尝试使用 initdb 和 pg_ctl 命令时,操作系统告诉我没有这样的命令。我做了什么:
使用 root 用户安装了 PostgreSQL 9.1
apt-get update和apt-get install postgresql-9.1。使用
mkdir /var/lib/postgresql/data创建了data文件夹已编辑
/etc/environment文件,包含 2 行:PATH+="/usr/lib/postgresql/9.1/bin" PGDATA="/var/lib/postgresql/data"
我在 bin 文件夹中看到了 initdb 和 pg_ctl,但我得到了
pg_ctl: 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"?
我错过了什么?
【问题讨论】:
-
你为什么要安装过时和未维护的 Postgres 版本?
-
因为当我尝试安装
apt-get install postgresql-10时,我收到 E: Unable to correct questions, you have changed packages. 错误 -
然后尝试修复那个,而不是使用不受支持和过时的版本。 9.1 已经是out of support 2 年了。至少使用一些更新的例如9.6 或 9.5,如果您无法修复损坏的软件包。
-
我在尝试安装
apt-get install postgresql-9.6时遇到同样的损坏包错误@
标签: postgresql installation debian postgresql-9.1