linux - 在 ubuntu 上安装 postgresql

标签 linux database postgresql ubuntu

<分区>

当我尝试通过在 Ubuntu 操作系统上运行该命令来安装 Postgres 数据库时出现以下错误 sudo apt-get install postgresql-9.4

dpkg: error processing package postgresql-9.4 (--configure): subprocess installed post-installation script returned error exit status 2 dpkg: dependency problems prevent configuration of postgresql-contrib-9.4: postgresql-contrib-9.4 depends on postgresql-9.4 (= 9.4.11-1.pgdg16.04+1); however: Package postgresql-9.4 is not configured yet. dpkg: error processing package postgresql-contrib-9.4 (--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.4 postgresql-contrib-9.4 E: Sub-process /usr/bin/dpkg returned an error code (1)

最佳答案

如果您尝试了多种解决方案,您可能会从这些尝试中得到一些剩余。 要从“从头开始”开始,您必须在尝试任何操作之前卸载所有内容并清理您的系统:

sudo apt-get purge 'postgresql.*'

这将卸载所有包并删除所有配置文件。 注意:这也会从您的系统中删除所有数据库文件。

之后您必须检查您添加到系统中的存储库。 检查/etc/apt/sources.list 文件和/etc/apt/sources.list.d/目录中的所有其他文件。

删除与 postgresql 和 'pgdg' 相关的所有内容。

最后,您可以在此处遵循官方 postgresql 手册: https://wiki.postgresql.org/wiki/Apt

关于linux - 在 ubuntu 上安装 postgresql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43622611/

相关文章:

c# - Monogame 3.6 共享项目 intellisense 在 Monodevelop 7.5 中不起作用

database - 为应用程序生成数据

sql - 使用 SQL 组织日期/时间表 - Postgres

python - 在 Python 中的 psycopg2 中执行 .sql 模式

linux - UDP 的 Nginx 直接服务器返回

python - Barebones SWIG python C 接口(interface)在 OSX+clang 上出现段错误,而不是在 Linux+gcc 中

mysql - 从MySQL开始,以后改成MongoDB?

python - 处理 sqlalchemy 断开连接的更好方法

linux - 我如何在内核中使用性能计数器?

mysql - 使用mysql中的触发器将一个数据库的值复制到另一个数据库