hello, thank you for reporting. In a basic setup, i was unable to
reproduce. The error i found in the logs was:

/var/lib/dpkg/tmp.ci/preinst: 11: .: cannot open /usr/share/postgresql-
common/maintscripts-functions: No such file

that file is owned by `postgresql-client-common`. this package is listed
as `depends` in  postgresql-client-16 and postgresql-16 depends on
postgresql-client-16

1. could you ensure that postgreqsl-client-common is installed properly? if it 
was not installed before, normally it'd get pulled in by an upgrade.
2. if it is, could you try a re-install and see if it solves the problem?

$ sudo apt reinstall postgresql-client-common

otherwise, i haven't been able to reproduce installing or upgrading
postgresql in a VM

Reproduction steps

Case 1 : new install

* lxc launch ubuntu:noble --vm --config limits.memory=4GiB  # launch an LXC vm 
for 24.04
* lxc shell
* sudo apt update && sudo apt full-upgrade
* sudo apt install postgresql-16  

This installed successfully without issues

Case 2 : upgrade

* downloaded the first release image from 
https://cloud-images.ubuntu.com/releases/24.04/release-20240423/ (the .img)
* downloaded the lxd.tar.xz from the same page 
* lxc image import ubuntu-24.04-server-cloudimg-amd64-lxd.tar.xz 
ubuntu-24.04-server-cloudimg-amd64.img --alias noble-first-release
* lxc launch noble-first-release --vm --config limits.memory=4GiB
* lxc shell
* sudo apt update --snapshot 20240301T030400Z # updates pool and adds 
snapshot.ubuntu.com endpoint
* sudo apt install postgresql-16 --snapshot 20240301T030400Z # install postgres 
from snapshot.
# Do you want to continue? [Y/n] Y
Get:1 https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble/main amd64 
libjson-perl all 4.10000-1 [81.9 kB]
Get:2 https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble/main amd64 
postgresql-client-common all 257 [36.2 kB]
Get:3 https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble/main amd64 
ssl-cert all 1.1.2ubuntu1 [17.8 kB]
Get:4 https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble/main amd64 
postgresql-common all 257 [162 kB]
Get:5 https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble/main amd64 
libcommon-sense-perl amd64 3.75-3build1 [20.3 kB]
Get:6 https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble/main amd64 
libtypes-serialiser-perl all 1.01-1 [11.6 kB]
Get:7 https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble/main amd64 
libjson-xs-perl amd64 4.030-2build1 [83.5 kB]
Get:8 https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble/main amd64 
libllvm17 amd64 1:17.0.6-5build1 [26.2 MB]
Get:9 https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble/main amd64 
libpq5 amd64 16.2-1 [138 kB]
Get:10 https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble/main amd64 
postgresql-client-16 amd64 16.2-1 [1269 kB]
Get:11 https://snapshot.ubuntu.com/ubuntu/20240301T030400Z noble/main amd64 
postgresql-16 amd64 16.2-1 [15.5 MB]
Fetched 43.4 MB in 6s (7391 kB/s)        
# as you can see, install postgres 16.2-1 from the snapshot, so much older
* sudo apt update
* sudo apt install --upgrade postgresql-16
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libllvm17t64 libpq5 postgresql-client-16
Suggested packages:
  postgresql-doc-16
The following packages will be REMOVED:
  libllvm17
The following NEW packages will be installed:
  libllvm17t64
The following packages will be upgraded:
  libpq5 postgresql-16 postgresql-client-16
3 upgraded, 1 newly installed, 1 to remove and 219 not upgraded.
Need to get 43.1 MB of archives.
After this operation, 369 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 postgresql-16 
amd64 16.6-0ubuntu0.24.04.1 [15.5 MB]
Get:2 http://archive.ubuntu.com/ubuntu noble/main amd64 libllvm17t64 amd64 
1:17.0.6-9ubuntu1 [26.2 MB]
Get:3 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libpq5 amd64 
16.6-0ubuntu0.24.04.1 [141 kB]
Get:4 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 
postgresql-client-16 amd64 16.6-0ubuntu0.24.04.1 [1271 kB]
Fetched 43.1 MB in 1s (34.2 MB/s)          
Preconfiguring packages ...
<snip>
succeeds

looking at the history, it looks like the upgrade is from 16.4 to 16.6

postgresql-16:amd64 (16.4-0ubuntu0.24.04.2, 16.6-0ubuntu0.24.04.1)

hunted around a bit and found a snapshot that had it:

sudo apt install postgresql-16 --snapshot 20241001T030400Z

<snip>

Get:1 https://snapshot.ubuntu.com/ubuntu/20241001T030400Z noble/main amd64 
libjson-perl all 4.10000-1 [81.9 kB]
Get:2 https://snapshot.ubuntu.com/ubuntu/20241001T030400Z noble-updates/main 
amd64 postgresql-client-common all 257build1.1 [36.4 kB]
Get:3 https://snapshot.ubuntu.com/ubuntu/20241001T030400Z noble/main amd64 
ssl-cert all 1.1.2ubuntu1 [17.8 kB]
Get:4 https://snapshot.ubuntu.com/ubuntu/20241001T030400Z noble-updates/main 
amd64 postgresql-common all 257build1.1 [161 kB]
Get:5 https://snapshot.ubuntu.com/ubuntu/20241001T030400Z noble/main amd64 
libcommon-sense-perl amd64 3.75-3build3 [20.4 kB]
Get:6 https://snapshot.ubuntu.com/ubuntu/20241001T030400Z noble/main amd64 
libtypes-serialiser-perl all 1.01-1 [11.6 kB]
Get:7 https://snapshot.ubuntu.com/ubuntu/20241001T030400Z noble/main amd64 
libjson-xs-perl amd64 4.030-2build3 [83.6 kB]
Get:8 https://snapshot.ubuntu.com/ubuntu/20241001T030400Z noble/main amd64 
libllvm17t64 amd64 1:17.0.6-9ubuntu1 [26.2 MB]
Get:9 https://snapshot.ubuntu.com/ubuntu/20241001T030400Z noble-updates/main 
amd64 libpq5 amd64 16.4-0ubuntu0.24.04.2 [141 kB]
Get:10 https://snapshot.ubuntu.com/ubuntu/20241001T030400Z noble-updates/main 
amd64 postgresql-client-16 amd64 16.4-0ubuntu0.24.04.2 [1271 kB]
Get:11 https://snapshot.ubuntu.com/ubuntu/20241001T030400Z noble-updates/main 
amd64 postgresql-16 amd64 16.4-0ubuntu0.24.04.2 [15.5 MB]
Fetched 43.5 MB in 6s (6713 kB/s)  

installed fine

then upgraded to latest

sudo apt install --upgrade postgresql-16

Get:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libpq5 amd64 
16.6-0ubuntu0.24.04.1 [141 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 
postgresql-client-16 amd64 16.6-0ubuntu0.24.04.1 [1271 kB]
Get:3 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 postgresql-16 
amd64 16.6-0ubuntu0.24.04.1 [15.5 MB]

upgrade was fine.



** Changed in: postgresql-16 (Ubuntu)
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2092140

Title:
  package postgresql-16 16.4-0ubuntu0.24.04.2 failed to install/upgrade:
  o subprocesso do pacote postgresql-16, novo script pre-installation
  retornou erro do status de saída 2

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/postgresql-16/+bug/2092140/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to