首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Debian 11上安装PostgreSQL时出错

在Debian 11上安装PostgreSQL时出错
EN

Stack Overflow用户
提问于 2022-02-10 13:15:31
回答 1查看 1.7K关注 0票数 2

未能在Debian 11上安装PostgreSQL

第一次安装软件包:sudo apt install postgresql

代码语言:javascript
复制
...
Unpacking postgresql (13+225) ...
Setting up postgresql-client-common (225) ...
Setting up libpq5:amd64 (13.5-0+deb11u1) ...
Setting up postgresql-client-13 (13.5-0+deb11u1) ...
double free or corruption (!prev)
dpkg: error processing package postgresql-client-13 (--configure):
 installed postgresql-client-13 package post-installation script subprocess was killed by signal (Aborted)
Setting up libz3-4:amd64 (4.8.10-1) ...
Setting up libllvm11:amd64 (1:11.0.1-2) ...
Setting up postgresql-common (225) ...
Adding user postgres to group ssl-cert

Creating config file /etc/postgresql-common/createcluster.conf with new version
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql.service → /lib/systemd/system/postgresql.service.
dpkg: dependency problems prevent configuration of postgresql-13:
 postgresql-13 depends on postgresql-client-13; however:
  Package postgresql-client-13 is not configured yet.

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

dpkg: error processing package postgresql (--configure):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+deb11u2) ...
Errors were encountered while processing:
 postgresql-client-13
 postgresql-13
 postgresql
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

请看,包postgresql 13显示为"iF“状态(配置失败),其他失败包显示为"iU”状态。

dpkg -l | grep postgres

代码语言:javascript
复制
iU  postgresql                    13+225                         all          object-relational SQL database (supported version)
iU  postgresql-13                 13.5-0+deb11u1                 amd64        The World's Most Advanced Open Source Relational Database
iF  postgresql-client-13          13.5-0+deb11u1                 amd64        front-end programs for PostgreSQL 13
ii  postgresql-client-common      225                            all          manager for multiple PostgreSQL client versions
ii  postgresql-common             225                            all          PostgreSQL database-cluster manager

第二个字母->当前包裹状态:

代码语言:javascript
复制
i ... installed
U ... unpacked
F ... half-configured (configuration failed for some reason)

获取包状态表,在:https://askubuntu.com/questions/18804/what-do-the-various-dpkg-flags-like-ii-rc-mean

我删除了所有PostgreSQL包和使用:sudo apt purge postgresql的所有文件

之后,我再次尝试安装PostgreSQLClient-13,它返回了上面的错误。sudo apt install postgresql-client-13

代码语言:javascript
复制
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libllvm11 libz3-4
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  postgresql-client-common
Suggested packages:
  postgresql-13 postgresql-doc-13
The following NEW packages will be installed:
  postgresql-client-13 postgresql-client-common
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,603 kB of archives.
After this operation, 6,789 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package postgresql-client-common.
(Reading database ... 39655 files and directories currently installed.)
Preparing to unpack .../postgresql-client-common_225_all.deb ...
Unpacking postgresql-client-common (225) ...
Selecting previously unselected package postgresql-client-13.
Preparing to unpack .../postgresql-client-13_13.5-0+deb11u1_amd64.deb ...
Unpacking postgresql-client-13 (13.5-0+deb11u1) ...
Setting up postgresql-client-common (225) ...
Setting up postgresql-client-13 (13.5-0+deb11u1) ...
double free or corruption (!prev)
dpkg: error processing package postgresql-client-13 (--configure):
 installed postgresql-client-13 package post-installation script subprocess was killed by signal (Aborted)
Processing triggers for man-db (2.9.4-2) ...
Errors were encountered while processing:
 postgresql-client-13
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-02-10 13:15:31

这个问题与以前安装的史努比包的存在有关。

sudo apt remove snoopy卸载史努比,然后安装PostgreSQL或PostgreSQLClient-13。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71065800

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档