尝试将 PostgreSQL 13 实例升级到版本 16 时,我遇到了麻烦。在此之前,我顺利地从 11 升级到 13,但现在安装 16 时出现了问题。
我愿意:
sudo apt install postgresql-16
并期望随后在 中找到配置文件/etc/postgresql/16
,但没有这样的文件夹。此外,pg_lsclusters
仅返回版本 13。我可以执行sudo -u postgres /lib/postgresql/16/bin/initdb -D /var/lib/postgresql/16/main
,这将起作用,但随后不会出现任何服务(如),并且集群仍未出现在列表中。systemctl status [email protected]
我找不到任何线索来判断原因,或者如何继续。我apt purge
多次尝试安装,然后重新安装,但都无济于事。此外,我在安装 PG 15 时也有同样的经历。欢迎提出任何想法,谢谢!
作为参考,这是安装的输出:
user@server:/etc/postgresql$ sudo apt install postgresql-16
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
postgresql-client-16
Suggested packages:
postgresql-doc-16
The following NEW packages will be installed:
postgresql-16 postgresql-client-16
0 upgraded, 2 newly installed, 0 to remove and 304 not upgraded.
Need to get 20.1 MB of archives.
After this operation, 69.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 https://apt.postgresql.org/pub/repos/apt jammy-pgdg/main amd64 postgresql-client-16 amd64 16.8-1.pgdg22.04+1 [1913 kB]
Get:2 https://apt.postgresql.org/pub/repos/apt jammy-pgdg/main amd64 postgresql-16 amd64 16.8-1.pgdg22.04+1 [18.1 MB]
Fetched 20.1 MB in 2s (9535 kB/s)
Preconfiguring packages ...
Selecting previously unselected package postgresql-client-16.
(Reading database ... 202138 files and directories currently installed.)
Preparing to unpack .../postgresql-client-16_16.8-1.pgdg22.04+1_amd64.deb ...
Unpacking postgresql-client-16 (16.8-1.pgdg22.04+1) ...
Selecting previously unselected package postgresql-16.
Preparing to unpack .../postgresql-16_16.8-1.pgdg22.04+1_amd64.deb ...
Unpacking postgresql-16 (16.8-1.pgdg22.04+1) ...
Setting up postgresql-client-16 (16.8-1.pgdg22.04+1) ...
update-alternatives: using /usr/share/postgresql/16/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
Setting up postgresql-16 (16.8-1.pgdg22.04+1) ...
Processing triggers for postgresql-common (274.pgdg22.04+1) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
user@server:/etc/postgresql$ ls
13
user@server:/etc/postgresql$
编辑:我希望这是提出这个问题/问题的正确地方。如果不是,请发表评论。我将其放在 stackexchange 中,几分钟后就关闭了,没有任何评论。很高兴收到任何意见,包括对我的帖子的意见!