pkg upgrade installations of postgresql13-client then conflicting postgresql12-client; and then an sqlite error

With a routine pkg upgrade, apparently installation of databases/postgresql13-client 13.4 was followed by an impossible (conflicting) attempt to install databases/postgresql12-client 12.8.

2021-11-13 03:27:07 postgresql client conflicts.png

Should I report a bug?

If so: where (against which port)?

The subsequent run also stopped:

2021-11-13 03:40:20 sqlite error.png

Code:
pkg: sqlite error while executing COMMIT TRANSACTION in file pkgdb.c:1312: database is locked
pkg: sqlite error while executing BEGIN IMMEDIATE TRANSACTION in file pkgdb.c:1312: cannot start a transaction within a transaction

<https://github.com/freebsd/pkg/blob/284d5ef57485dc169c44acce3c09d92be90ec1fa/libpkg/pkgdb.c#L1312>

The subsequent run detected a missing file (no surprise, given the preceding error) but ultimately succeeded:

2021-11-13 03:45:41 Firefox missing file.png

FreeBSD 13.0-RELEASE-p5 userland.
 
Read /usr/ports/UPDATING for information how to update postgresql if you don't use ports and you are missing /usr/ports directory then check the file on the github at the following address

20211024:
AFFECTS: users of databases/postgresql* and other software using PostgreSQL to run


Howto update:

Write down which ports depends on PostgresqlXXX-client. You will need to force reinstall them after upgrading the postgresql. So they don't break dependency and not be removed next time when you use pkg autoremove
Example in my case where XXX is the current installed version of client/server:

% pkg info -r postgresqlXXX-client-XXX
postgresqlXXXX-client-XXXX:
dovecot-2.3.17_1
php74-pdo_pgsql-7.4.25
php74-pgsql-7.4.25
postfix-3.6.2_3,1
p5-DBD-Pg-3.15.0
postgresqlXX-server-XXXX

Here's upgrading from postgresql10.17-client/server -> version 13
su
service postgresql stop
cd /root
pkg create postgresql10-server
mkdir /tmp/pg-upgrade
tar xf postgresql10-server-10.17_1.txz -C /tmp/pg-upgrade
note: Don't miss "-f" otherwise all dependencies of postgresql10-client will be also deleted.
pkg delete -f databases/postgresql10-server databases/postgresql10-client
note: i'm using PORTS to install if you are using pkg adapt your next command (pkg install ...). postgresql13-client will be installed as dependency of postgresql13-server
portinstall databases/postgresql13-server
portupgrade -f dovecot postfix p5-DBD-Pg php74-pdo_pgsql php74-pgsql
portupgrade -a
rehash
su -l postgres -c "/usr/local/bin/initdb --encoding=utf-8 --lc-collate=C -D /var/db/postgres/data13 -U postgres"
chown -R postgres /usr/local/pgsql/data
/var/db/postgres/data10 must reflect your actual postgres db location for version 12 it will be /var/db/postgres/data12 adapt your next command according it.
-d "source"
-D "destination" should be data13 for postgres13
su -l postgres -c "pg_upgrade -b /tmp/pg-upgrade/usr/local/bin/ -d /var/db/postgres/data10 -B /usr/local/bin/ -D /var/db/postgres/data13/ -U postgres "
service postgresql start
/var/db/postgres/analyze_new_cluster.sh
 
There's no server.

Not pictured, but one of the first things that I did after the errors was pkg autoremove; nothing was (or is) to be removed.

Code:
grahamperrin@mowa219-gjp4-vm-freebsd-13-zfs:~ % pkg info -x postgresql
postgresql13-client-13.4
grahamperrin@mowa219-gjp4-vm-freebsd-13-zfs:~ % su -
Password:
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # date ; uptime ; freebsd-version -kru
Sat Nov 13 08:25:58 GMT 2021
 8:25AM  up 7 mins, 2 users, load averages: 0.30, 1.69, 1.28
13.0-RELEASE-p4
13.0-RELEASE-p4
13.0-RELEASE-p5
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # uname -aKU
FreeBSD mowa219-gjp4-vm-freebsd-13-zfs 13.0-RELEASE-p4 FreeBSD 13.0-RELEASE-p4 #0: Tue Aug 24 07:33:27 UTC 2021     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64 1300139 1300139
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # pkg autoremove
Checking integrity... done (0 conflicting)
Nothing to do.
root@mowa219-gjp4-vm-freebsd-13-zfs:~ #

Code:
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # pkg check --shlibs --dependencies --all --dry-run
Checking all packages:   0%
(FreeBSD-bhyve-13.0) /usr/sbin/bhyve - required shared library libcap_pwd.so.1 not found
(FreeBSD-bhyve-13.0) /usr/sbin/bhyve - required shared library libcap_grp.so.1 not found
Checking all packages:   1%
pkg: fstat() failed for(/usr/share/certs/trusted/Camerfirma_Chambers_of_Commerce_Root.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/Camerfirma_Global_Chambersign_Root.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/Certum_Root_CA.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/Chambers_of_Commerce_Root_-_2008.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/D-TRUST_Root_CA_3_2013.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/EC-ACC.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/GeoTrust_Primary_Certification_Authority_-_G2.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/Global_Chambersign_Root_-_2008.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/OISTE_WISeKey_Global_Root_GA_CA.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/QuoVadis_Root_CA.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/Sonera_Class_2_Root_CA.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/Staat_der_Nederlanden_Root_CA_-_G3.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/SwissSign_Platinum_CA_-_G2.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/Symantec_Class_1_Public_Primary_Certification_Authority_-_G6.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/Symantec_Class_2_Public_Primary_Certification_Authority_-_G6.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/Trustis_FPS_Root_CA.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/VeriSign_Universal_Root_Certification_Authority.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/Verisign_Class_1_Public_Primary_Certification_Authority_-_G3.pem): No such file or directory
pkg: fstat() failed for(/usr/share/certs/trusted/Verisign_Class_2_Public_Primary_Certification_Authority_-_G3.pem): No such file or directory
Checking all packages:   4%
(FreeBSD-kernel-generic-13.0) /boot/kernel/kernel - required shared library hack.pico not found
Checking all packages:   4%
(FreeBSD-kernel-generic-mmccam-13.0) /boot/kernel.GENERIC-MMCCAM/kernel - required shared library hack.pico not found
Checking all packages:   4%
(FreeBSD-kernel-minimal-13.0) /boot/kernel.MINIMAL/kernel - required shared library hack.pico not found
Checking all packages:  22%
(FreeBSD-tests-13.0) /usr/tests/lib/libcasper/services/cap_dns/dns_test - required shared library libcap_dns.so.2 not found
(FreeBSD-tests-13.0) /usr/tests/lib/libcasper/services/cap_fileargs/fileargs_test - required shared library libcap_fileargs.so.1 not found
(FreeBSD-tests-13.0) /usr/tests/lib/libcasper/services/cap_grp/grp_test - required shared library libcap_grp.so.1 not found
(FreeBSD-tests-13.0) /usr/tests/lib/libcasper/services/cap_net/net_test - required shared library libcap_net.so.1 not found
(FreeBSD-tests-13.0) /usr/tests/lib/libcasper/services/cap_pwd/pwd_test - required shared library libcap_pwd.so.1 not found
(FreeBSD-tests-13.0) /usr/tests/lib/libcasper/services/cap_sysctl/sysctl_test - required shared library libcap_sysctl.so.2 not found
Checking all packages:  22%
(FreeBSD-utilities-13.0) /usr/bin/brandelf - required shared library libcap_fileargs.so.1 not found
(FreeBSD-utilities-13.0) /usr/bin/head - required shared library libcap_fileargs.so.1 not found
(FreeBSD-utilities-13.0) /usr/bin/kdump - required shared library libcap_grp.so.1 not found
(FreeBSD-utilities-13.0) /usr/bin/kdump - required shared library libcap_pwd.so.1 not found
(FreeBSD-utilities-13.0) /usr/bin/logger - required shared library libcap_syslog.so.1 not found
(FreeBSD-utilities-13.0) /usr/bin/nm - required shared library libcap_fileargs.so.1 not found
(FreeBSD-utilities-13.0) /usr/bin/readelf - required shared library libcap_fileargs.so.1 not found
(FreeBSD-utilities-13.0) /usr/bin/size - required shared library libcap_fileargs.so.1 not found
(FreeBSD-utilities-13.0) /usr/bin/strings - required shared library libcap_fileargs.so.1 not found
(FreeBSD-utilities-13.0) /usr/bin/tail - required shared library libcap_fileargs.so.1 not found
(FreeBSD-utilities-13.0) /usr/bin/wc - required shared library libcap_fileargs.so.1 not found
(FreeBSD-utilities-13.0) /usr/sbin/rtsold - required shared library libcap_syslog.so.1 not found
(FreeBSD-utilities-13.0) /usr/sbin/tcpdump - required shared library libcap_dns.so.2 not found
Checking all packages:  64%     
(libreoffice-7.2.2.2_2) /usr/local/lib/libreoffice/program/libofficebean.so - required shared library libjawt.so not found
Checking all packages:  90%
(speech-dispatcher-0.10.2) /usr/local/lib/speech-dispatcher-modules/sd_voxin - required shared library libvoxin.so not found
Checking all packages: 100%
FreeBSD-libcompiler_rt-dev has a missing dependency: FreeBSD-libcompiler-rt
FreeBSD-libcompiler_rt-dev-lib32 has a missing dependency: FreeBSD-libcompiler-rt-dev
FreeBSD-libcompiler_rt-lib32 has a missing dependency: FreeBSD-libcompiler-rt
FreeBSD-librpcsec_gss-dbg has a missing dependency: FreeBSD-librpcsec-gss
FreeBSD-librpcsec_gss-dbg-lib32 has a missing dependency: FreeBSD-librpcsec-gss-dbg
FreeBSD-librpcsec_gss-dev has a missing dependency: FreeBSD-librpcsec-gss
FreeBSD-librpcsec_gss-dev-lib32 has a missing dependency: FreeBSD-librpcsec-gss-dev
FreeBSD-librpcsec_gss-lib32 has a missing dependency: FreeBSD-librpcsec-gss
FreeBSD-libthread_db-dbg has a missing dependency: FreeBSD-libthread-db
FreeBSD-libthread_db-dbg-lib32 has a missing dependency: FreeBSD-libthread-db-dbg
FreeBSD-libthread_db-dev has a missing dependency: FreeBSD-libthread-db
FreeBSD-libthread_db-dev-lib32 has a missing dependency: FreeBSD-libthread-db-dev
FreeBSD-libthread_db-lib32 has a missing dependency: FreeBSD-libthread-db
FreeBSD-liby-dev has a missing dependency: FreeBSD-liby
root@mowa219-gjp4-vm-freebsd-13-zfs:~ #

Code:
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # pkg check -d
Checking all packages: 100%
FreeBSD-libcompiler_rt-dev has a missing dependency: FreeBSD-libcompiler-rt
FreeBSD-libcompiler_rt-dev-lib32 has a missing dependency: FreeBSD-libcompiler-rt-dev
FreeBSD-libcompiler_rt-lib32 has a missing dependency: FreeBSD-libcompiler-rt
FreeBSD-librpcsec_gss-dbg has a missing dependency: FreeBSD-librpcsec-gss
FreeBSD-librpcsec_gss-dbg-lib32 has a missing dependency: FreeBSD-librpcsec-gss-dbg
FreeBSD-librpcsec_gss-dev has a missing dependency: FreeBSD-librpcsec-gss
FreeBSD-librpcsec_gss-dev-lib32 has a missing dependency: FreeBSD-librpcsec-gss-dev
FreeBSD-librpcsec_gss-lib32 has a missing dependency: FreeBSD-librpcsec-gss
FreeBSD-libthread_db-dbg has a missing dependency: FreeBSD-libthread-db
FreeBSD-libthread_db-dbg-lib32 has a missing dependency: FreeBSD-libthread-db-dbg
FreeBSD-libthread_db-dev has a missing dependency: FreeBSD-libthread-db
FreeBSD-libthread_db-dev-lib32 has a missing dependency: FreeBSD-libthread-db-dev
FreeBSD-libthread_db-lib32 has a missing dependency: FreeBSD-libthread-db
FreeBSD-liby-dev has a missing dependency: FreeBSD-liby

>>> Missing package dependencies were detected.
>>> Found 9 issue(s) in the package database.

pkg: No packages available to install matching 'FreeBSD-libcompiler-rt' have been found in the repositories
pkg: No packages available to install matching 'FreeBSD-libcompiler-rt-dev' have been found in the repositories
pkg: No packages available to install matching 'FreeBSD-librpcsec-gss' have been found in the repositories
pkg: No packages available to install matching 'FreeBSD-librpcsec-gss-dbg' have been found in the repositories
pkg: No packages available to install matching 'FreeBSD-librpcsec-gss-dev' have been found in the repositories
pkg: No packages available to install matching 'FreeBSD-libthread-db' have been found in the repositories
pkg: No packages available to install matching 'FreeBSD-libthread-db-dbg' have been found in the repositories
pkg: No packages available to install matching 'FreeBSD-libthread-db-dev' have been found in the repositories
pkg: No packages available to install matching 'FreeBSD-liby' have been found in the repositories
>>> Summary of actions performed:

FreeBSD-libcompiler-rt dependency failed to be fixed
FreeBSD-libcompiler-rt-dev dependency failed to be fixed
FreeBSD-librpcsec-gss dependency failed to be fixed
FreeBSD-librpcsec-gss-dbg dependency failed to be fixed
FreeBSD-librpcsec-gss-dev dependency failed to be fixed
FreeBSD-libthread-db dependency failed to be fixed
FreeBSD-libthread-db-dbg dependency failed to be fixed
FreeBSD-libthread-db-dev dependency failed to be fixed
FreeBSD-liby dependency failed to be fixed

>>> There are still missing dependencies.
>>> Try fixing them manually.

>>> Also make sure to check 'pkg updating' for known issues.
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # pkg upgrade -f -y --quiet
 
Did you check which pkg requires postgresql12-client?

Not before pkg upgrade.

Following completion of the upgrade (the third run), there was no requirement, which made me wonder why installation was attempted during the first run.

I can't perform a recheck right now (in the midst of pkg upgrade -f -y), however I do recall that kdemultimedia (and so, kde5) was within the output from pkg delete -n postgresql13-client. Probably much the same as I get with my everyday computer (not a virtual machine):

Code:
root@mowa219-gjp4-8570p-freebsd:~ # freebsd-version -kru
14.0-CURRENT
14.0-CURRENT
14.0-CURRENT
root@mowa219-gjp4-8570p-freebsd:~ # pkg delete -n postgresql13-client
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 11 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        frei0r-plugins: 1.7.0.18
        frei0r-plugins-opencv: 1.7.0.18
        gdal: 3.3.3
        gstreamer1-plugins-all: 1.16_1
        gstreamer1-plugins-opencv: 1.16.2_1
        kde5: 5.23.2.21.08.3
        kdemultimedia: 21.08.3_1
        kdenlive: 21.08.3
        opencv: 4.5.3_4
        postgresql13-client: 13.4
        shotcut: 21.03.21_3

Number of packages to be removed: 11

The operation will free 268 MiB.
root@mowa219-gjp4-8570p-freebsd:~ #
 
Well this is all very interesting.

I upgraded postgresql12-server (and client) to postgresql13-server and client, on "latest" packages the other night (October 27), and the upgrade handled it okay, although the upgrade "resolver" came into play after the first "pass," and required a 2nd iteration. This October 27 processing also upgraded pkg-1.17.2 to pkg-1.17.3.

When I tried to upgrade using "quarterly" packages, however, a similar resolution strategy failed. I don't recall all the details, but I ultimately wound up downgrading back to postgresql12-server and client. Note that quarterly repos were still on pkg-1.17.2 on October 28, and they're still on 1.17.2 today.

In both upgrade efforts, of course, it was necessary to restore the postgresql database from backup afterwards.

Today, the "latest" pkg upgrade has upgraded my pkg-1.17.3 to pkg-1.17.4. I'm guessing that you also have pkg-1.17.4, and that 1.17.3 may be the reason why my October 27 upgrade succeeded, and yours failed.

Note also that the "quarterly" repo and pkg-1.17.2 are not even recommending the upgrade from postgresql version 12 to 13 as of yet. However, knowing that postgresql 13 was available, I tried to force the issue with a pkg install postgresql13-server.

Since reading this thread, I've been testing the postgresql version 13 and it seems a bit flaky (error-prone), so I'll probably wind up downgrading it to version 12 sometime tomorrow. I was not experiencing any errors with version 12. Based this thread, another thread about php8.0, and my own experiences, I'll probably be sticking with postgresql 12.8 and php 7.4.25 for awhile.

My own requirement trace of postgresql13-client:
Code:
$ pkg info -r postgresql13-client
postgresql13-client-13.4:
        gdal-3.3.3
        postgresql13-server-13.4_1
        php74-pgsql-7.4.25

Note also the odd discrepancy between client and server sub-version numbers: 13.4 vs. 13.4_1.
 
I shouldn't describe my case as a problem with an upgrade to the PostgreSQL client.

There was successful installation of postgresql13-client followed by an inexplicable improper attempt to install postgresql12-client; the latter is ultimately not required.

… guessing that you also have pkg-1.17.4 …

True;

Code:
grahamperrin@mowa219-gjp4-vm-freebsd-13-zfs:~ % pkg -vv | grep url
    url             : "pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/latest",
    url             : "https://alpha.pkgbase.live/current/FreeBSD:13:amd64/latest",
    url             : "file:///usr/local/poudriere/data/packages/13-default",
grahamperrin@mowa219-gjp4-vm-freebsd-13-zfs:~ % pkg -vv | grep enabled
    enabled         : yes,
    enabled         : no,
    enabled         : yes,
grahamperrin@mowa219-gjp4-vm-freebsd-13-zfs:~ % pkg -vv | grep priority
    priority        : 0,
    priority        : 0,
    priority        : 4
grahamperrin@mowa219-gjp4-vm-freebsd-13-zfs:~ %
 
For reference only (not seeking support):

(in the midst of pkg upgrade -f -y)

Code:
…
[377/1078] Reinstalling linux_base-c7-7.9.2009...
Cannot install package: kernel missing 64-bit Linux support
pkg: PRE-INSTALL script failed
root@mowa219-gjp4-vm-freebsd-13-zfs:~ #

Code:
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # date
Sat Nov 13 10:57:17 GMT 2021
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # pkg upgrade -f linux_base-c7
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating poudriere repository catalogue...
poudriere repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        linux_base-c7-7.9.2009 [poudriere]

Number of packages to be reinstalled: 1

Proceed with this action? [y/N]: n
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # pkg upgrade -f -r FreeBSD linux_base-c7
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
        linux_base-c7-7.9.2009 [FreeBSD]

Number of packages to be reinstalled: 1

35 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching linux_base-c7-7.9.2009.pkg: 100%   35 MiB   5.3MB/s    00:07  
Checking integrity... done (0 conflicting)
[1/1] Reinstalling linux_base-c7-7.9.2009...
Cannot install package: kernel missing 64-bit Linux support
pkg: PRE-INSTALL script failed
root@mowa219-gjp4-vm-freebsd-13-zfs:~ #

Code:
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # pkg delete linux_base-c7
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 37 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        citrix_ica: 13.10.0
        linux-c7-alsa-lib: 1.1.8
        linux-c7-atk: 2.28.1_1
        linux-c7-cairo: 1.15.12_1
        linux-c7-curl: 7.29.0_12
        linux-c7-cyrus-sasl-lib: 2.1.26_4
        linux-c7-dri: 18.3.4_4
        linux-c7-elfutils-libelf: 0.176_2
        linux-c7-expat: 2.1.0_4
        linux-c7-fontconfig: 2.13.0
        linux-c7-freetype: 2.8_2
        linux-c7-fribidi: 1.0.2_1
        linux-c7-gdk-pixbuf2: 2.36.12
        linux-c7-graphite2: 1.3.10
        linux-c7-gtk2: 2.24.31
        linux-c7-harfbuzz: 1.7.5
        linux-c7-jasper-libs: 1.900.1_5
        linux-c7-jbigkit-libs: 2.0_2
        linux-c7-jpeg: 1.2.90_4
        linux-c7-libdrm: 2.4.97
        linux-c7-libglvnd: 1.0.1
        linux-c7-libpciaccess: 0.14
        linux-c7-libpng: 1.5.13_3
        linux-c7-libssh2: 1.8.0_1
        linux-c7-libthai: 0.1.14_1
        linux-c7-libtiff: 4.0.3_5
        linux-c7-libxml2: 2.9.1_3
        linux-c7-motif: 2.3.4_6
        linux-c7-nspr: 4.25.0
        linux-c7-nss: 3.53.1
        linux-c7-openldap: 2.4.44_2
        linux-c7-pango: 1.42.4_1
        linux-c7-pixman: 0.34.0
        linux-c7-sqlite: 3.7.17_2
        linux-c7-wayland: 1.15.0
        linux-c7-xorg-libs: 7.7_9
        linux_base-c7: 7.9.2009

Number of packages to be removed: 37

The operation will free 623 MiB.

Proceed with deinstalling packages? [y/N]: n
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # pkg autoremove
Checking integrity... done (0 conflicting)
Nothing to do.
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # pkg delete citrix_ica
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        citrix_ica: 13.10.0

Number of packages to be removed: 1

The operation will free 55 MiB.

Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling citrix_ica-13.10.0...
[1/1] Deleting files for citrix_ica-13.10.0: 100%
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # pkg autoremove
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 28 packages:

Installed packages to be REMOVED:
        linux-c7-alsa-lib: 1.1.8
        linux-c7-atk: 2.28.1_1
        linux-c7-cairo: 1.15.12_1
        linux-c7-dri: 18.3.4_4
        linux-c7-elfutils-libelf: 0.176_2
        linux-c7-expat: 2.1.0_4
        linux-c7-fontconfig: 2.13.0
        linux-c7-freetype: 2.8_2
        linux-c7-fribidi: 1.0.2_1
        linux-c7-gdk-pixbuf2: 2.36.12
        linux-c7-graphite2: 1.3.10
        linux-c7-gtk2: 2.24.31
        linux-c7-harfbuzz: 1.7.5
        linux-c7-jasper-libs: 1.900.1_5
        linux-c7-jbigkit-libs: 2.0_2
        linux-c7-jpeg: 1.2.90_4
        linux-c7-libdrm: 2.4.97
        linux-c7-libglvnd: 1.0.1
        linux-c7-libpciaccess: 0.14
        linux-c7-libpng: 1.5.13_3
        linux-c7-libthai: 0.1.14_1
        linux-c7-libtiff: 4.0.3_5
        linux-c7-libxml2: 2.9.1_3
        linux-c7-motif: 2.3.4_6
        linux-c7-pango: 1.42.4_1
        linux-c7-pixman: 0.34.0
        linux-c7-wayland: 1.15.0
        linux-c7-xorg-libs: 7.7_9

Number of packages to be removed: 28

The operation will free 323 MiB.

Proceed with deinstalling packages? [y/N]: y
[1/28] Deinstalling linux-c7-gtk2-2.24.31...
[1/28] Deleting files for linux-c7-gtk2-2.24.31: 100%
[2/28] Deinstalling linux-c7-pango-1.42.4_1...
[2/28] Deleting files for linux-c7-pango-1.42.4_1: 100%
[3/28] Deinstalling linux-c7-cairo-1.15.12_1...
[3/28] Deleting files for linux-c7-cairo-1.15.12_1: 100%
[4/28] Deinstalling linux-c7-dri-18.3.4_4...
[4/28] Deleting files for linux-c7-dri-18.3.4_4: 100%
[5/28] Deinstalling linux-c7-motif-2.3.4_6...
[5/28] Deleting files for linux-c7-motif-2.3.4_6: 100%
[6/28] Deinstalling linux-c7-gdk-pixbuf2-2.36.12...
[6/28] Deleting files for linux-c7-gdk-pixbuf2-2.36.12: 100%
[7/28] Deinstalling linux-c7-libglvnd-1.0.1...
[7/28] Deleting files for linux-c7-libglvnd-1.0.1: 100%
[8/28] Deinstalling linux-c7-xorg-libs-7.7_9...
[8/28] Deleting files for linux-c7-xorg-libs-7.7_9: 100%
[9/28] Deinstalling linux-c7-fontconfig-2.13.0...
[9/28] Deleting files for linux-c7-fontconfig-2.13.0: 100%
[10/28] Deinstalling linux-c7-freetype-2.8_2...
[10/28] Deleting files for linux-c7-freetype-2.8_2: 100%
[11/28] Deinstalling linux-c7-harfbuzz-1.7.5...
[11/28] Deleting files for linux-c7-harfbuzz-1.7.5: 100%
[12/28] Deinstalling linux-c7-jasper-libs-1.900.1_5...
[12/28] Deleting files for linux-c7-jasper-libs-1.900.1_5: 100%
[13/28] Deinstalling linux-c7-libtiff-4.0.3_5...
[13/28] Deleting files for linux-c7-libtiff-4.0.3_5: 100%
[14/28] Deinstalling linux-c7-libdrm-2.4.97...
[14/28] Deleting files for linux-c7-libdrm-2.4.97: 100%
[15/28] Deinstalling linux-c7-alsa-lib-1.1.8...
[15/28] Deleting files for linux-c7-alsa-lib-1.1.8: 100%
[16/28] Deinstalling linux-c7-atk-2.28.1_1...
[16/28] Deleting files for linux-c7-atk-2.28.1_1: 100%
[17/28] Deinstalling linux-c7-elfutils-libelf-0.176_2...
[17/28] Deleting files for linux-c7-elfutils-libelf-0.176_2: 100%
[18/28] Deinstalling linux-c7-expat-2.1.0_4...
[18/28] Deleting files for linux-c7-expat-2.1.0_4: 100%
[19/28] Deinstalling linux-c7-fribidi-1.0.2_1...
[19/28] Deleting files for linux-c7-fribidi-1.0.2_1: 100%
[20/28] Deinstalling linux-c7-graphite2-1.3.10...
[20/28] Deleting files for linux-c7-graphite2-1.3.10: 100%
[21/28] Deinstalling linux-c7-jbigkit-libs-2.0_2...
[21/28] Deleting files for linux-c7-jbigkit-libs-2.0_2: 100%
[22/28] Deinstalling linux-c7-jpeg-1.2.90_4...
[22/28] Deleting files for linux-c7-jpeg-1.2.90_4: 100%
[23/28] Deinstalling linux-c7-libpciaccess-0.14...
[23/28] Deleting files for linux-c7-libpciaccess-0.14: 100%
[24/28] Deinstalling linux-c7-libpng-1.5.13_3...
[24/28] Deleting files for linux-c7-libpng-1.5.13_3: 100%
[25/28] Deinstalling linux-c7-libthai-0.1.14_1...
[25/28] Deleting files for linux-c7-libthai-0.1.14_1: 100%
[26/28] Deinstalling linux-c7-libxml2-2.9.1_3...
[26/28] Deleting files for linux-c7-libxml2-2.9.1_3: 100%
[27/28] Deinstalling linux-c7-pixman-0.34.0...
[27/28] Deleting files for linux-c7-pixman-0.34.0: 100%
[28/28] Deinstalling linux-c7-wayland-1.15.0...
[28/28] Deleting files for linux-c7-wayland-1.15.0: 100%
root@mowa219-gjp4-vm-freebsd-13-zfs:~ # pkg upgrade -f -y -r FreeBSD
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (1382 candidates): 100%
Processing candidates (1382 candidates): 100%
Checking integrity...

I don't need the Citrix software in this virtual machine. It was a relic from this topic:

 
Should I report a bug?
That's not a bug - that's normal on such database-packages: They contain f.e. binaries with the same locations and filenames. And a as long there are different versions to choose from: A packages system cannot and should not decide that you want to switch from 12 to 13 - so you've got to solve that by yourself.
 
A packages system cannot and should not decide that you want to switch from 12 to 13

Not even when 12 is no longer not required?

Re: the first image in the opening post, it's remarkable that neither line was an upgrade.
 
That's not a bug - that's normal on such database-packages: They contain f.e. binaries with the same locations and filenames. And a as long there are different versions to choose from: A packages system cannot and should not decide that you want to switch from 12 to 13 - so you've got to solve that by yourself.

root@plasma:~ # pkg info -E postgresql12-client
postgresql12-client-12.8
root@plasma:~ # pkg info -E postgresql12-server
postgresql12-server-12.8
root@plasma:~ # pkg info -E pkg
pkg-1.17.4
root@plasma:~ # pkg upgrade
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (286 candidates): 100%
Processing candidates (286 candidates): 100%
The following 288 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
postgresql13-client: 13.4

vmaf: 2.3.0_2

Installed packages to be UPGRADED:
akonadi: 21.08.2 -> 21.08.3
akonadi-calendar: 21.08.2 -> 21.08.3
akonadi-contacts: 21.08.2 -> 21.08.3
akonadi-import-wizard: 21.08.2 -> 21.08.3
akonadi-mime: 21.08.2 -> 21.08.3
akonadi-notes: 21.08.2 -> 21.08.3
akonadi-search: 21.08.2 -> 21.08.3
akonadiconsole: 21.08.2 -> 21.08.3
akregator: 21.08.2 -> 21.08.3
analitza: 21.08.2 -> 21.08.3
aom: 3.2.0 -> 3.2.0_1
ark: 21.08.2_1 -> 21.08.3_1
artikulate: 21.08.2 -> 21.08.3
audiocd-kio: 21.08.2 -> 21.08.3
baloo-widgets: 21.08.2 -> 21.08.3
blinken: 21.08.2 -> 21.08.3
bomber: 21.08.2 -> 21.08.3
boost-libs: 1.72.0_5 -> 1.72.0_6
bovo: 21.08.2 -> 21.08.3
calendarsupport: 21.08.2 -> 21.08.3
cantor: 21.08.2_2 -> 21.08.3_3
dolphin: 21.08.2 -> 21.08.3
dragon-player: 21.08.2 -> 21.08.3
eventviews: 21.08.2 -> 21.08.3
exiv2: 0.27.4,1 -> 0.27.5,1
ffmpeg: 4.4_6,1 -> 4.4.1_3,1
filelight: 21.08.2 -> 21.08.3
firefox: 93.0_2,2 -> 94.0.1_1,2
freerdp: 2.4.0 -> 2.4.1
gdal: 3.3.2_2 -> 3.3.3_1
gegl: 0.4.32_1 -> 0.4.32_2
gimp-app: 2.10.28_1,1 -> 2.10.28_2,1
glib: 2.70.0_1,2 -> 2.70.1,2
gnupg: 2.3.3 -> 2.3.3_1
granatier: 21.08.2 -> 21.08.3
grantlee-editor: 21.08.2 -> 21.08.3
grantleetheme: 21.08.2 -> 21.08.3
graphviz: 2.44.1_16 -> 2.44.1_17
gwenview: 21.08.2 -> 21.08.3
harfbuzz: 3.0.0 -> 3.1.1
harfbuzz-icu: 3.0.0 -> 3.1.1
icu: 69.1,1 -> 70.1_1,1
incidenceeditor: 21.08.2 -> 21.08.3
ja-kiten: 21.08.2 -> 21.08.3
jsoncpp: 1.9.4 -> 1.9.5
kaccounts-integration: 21.08.2 -> 21.08.3
kaddressbook: 21.08.2 -> 21.08.3
kalarm: 21.08.2 -> 21.08.3
kalarmcal: 21.08.2 -> 21.08.3
kalgebra: 21.08.2 -> 21.08.3
kamera: 21.08.2 -> 21.08.3
kanagram: 21.08.2 -> 21.08.3
kapman: 21.08.2 -> 21.08.3
kate: 21.08.2 -> 21.08.3
katomic: 21.08.2 -> 21.08.3
kblackbox: 21.08.2 -> 21.08.3
kblocks: 21.08.2 -> 21.08.3
kbounce: 21.08.2 -> 21.08.3
kbreakout: 21.08.2 -> 21.08.3
kbruch: 21.08.2 -> 21.08.3
kcalc: 21.08.2 -> 21.08.3
kcalutils: 21.08.2 -> 21.08.3
kcharselect: 21.08.2 -> 21.08.3
kcolorchooser: 21.08.2 -> 21.08.3
kcron: 21.08.2 -> 21.08.3
kde-baseapps: 21.08.2_1 -> 21.08.3_1
kde5: 5.23.1.21.08.2 -> 5.23.2.21.08.3
kdeadmin: 21.08.2 -> 21.08.3
kdebugsettings: 21.08.2 -> 21.08.3
kdeedu: 21.08.2 -> 21.08.3
kdegames: 21.08.2 -> 21.08.3
kdegraphics: 21.08.2 -> 21.08.3
kdegraphics-mobipocket: 21.08.2 -> 21.08.3
kdegraphics-svgpart: 21.08.2 -> 21.08.3
kdegraphics-thumbnailers: 21.08.2 -> 21.08.3
kdemultimedia: 21.08.2_1 -> 21.08.3_1
kdemultimedia-ffmpegthumbs: 21.08.2 -> 21.08.3
kdenetwork: 21.08.2 -> 21.08.3
kdenetwork-filesharing: 21.08.2 -> 21.08.3
kdenlive: 21.08.2 -> 21.08.3
kdepim: 21.08.2 -> 21.08.3
kdepim-addons: 21.08.2 -> 21.08.3
kdepim-runtime: 21.08.2 -> 21.08.3
kdeutils: 21.08.2 -> 21.08.3
kdf: 21.08.2 -> 21.08.3
kdialog: 21.08.2 -> 21.08.3
kdiamond: 21.08.2 -> 21.08.3
keditbookmarks: 21.08.2 -> 21.08.3
kf5-kfilemetadata: 5.87.0 -> 5.87.0_1
kfloppy: 21.08.2 -> 21.08.3
kfourinline: 21.08.2 -> 21.08.3
kgeography: 21.08.2 -> 21.08.3
kgpg: 21.08.2 -> 21.08.3
khangman: 21.08.2 -> 21.08.3
khelpcenter: 21.08.2 -> 21.08.3
kidentitymanagement: 21.08.2 -> 21.08.3
kig: 21.08.2 -> 21.08.3
killbots: 21.08.2 -> 21.08.3
kimap: 21.08.2 -> 21.08.3
kio-extras: 21.08.2 -> 21.08.3
kipi-plugins: 21.08.2 -> 21.08.3
kiriki: 21.08.2 -> 21.08.3
kitinerary: 21.08.2_2 -> 21.08.3_3
kjumpingcube: 21.08.2 -> 21.08.3
kldap: 21.08.2 -> 21.08.3
klettres: 21.08.2 -> 21.08.3
klickety: 21.08.2 -> 21.08.3
klines: 21.08.2 -> 21.08.3
kmahjongg: 21.08.2 -> 21.08.3
kmail: 21.08.2 -> 21.08.3
kmail-account-wizard: 21.08.2 -> 21.08.3
kmailtransport: 21.08.2 -> 21.08.3
kmbox: 21.08.2 -> 21.08.3
kmime: 21.08.2 -> 21.08.3
kmines: 21.08.2 -> 21.08.3
kmplot: 21.08.2 -> 21.08.3
knavalbattle: 21.08.2 -> 21.08.3
knetwalk: 21.08.2 -> 21.08.3
knights: 21.08.2 -> 21.08.3
kolf: 21.08.2 -> 21.08.3
kollision: 21.08.2 -> 21.08.3
kolourpaint: 21.08.2 -> 21.08.3
konquest: 21.08.2 -> 21.08.3
konsole: 21.08.2_1 -> 21.08.3_1
kontact: 21.08.2 -> 21.08.3
kontactinterface: 21.08.2 -> 21.08.3
kopete: 21.08.2 -> 21.08.3
korganizer: 21.08.2 -> 21.08.3
kpat: 21.08.2 -> 21.08.3
kpimtextedit: 21.08.2 -> 21.08.3
kpkpass: 21.08.2 -> 21.08.3
krdc: 21.08.2 -> 21.08.3
kreversi: 21.08.2 -> 21.08.3
krfb: 21.08.2 -> 21.08.3
kruler: 21.08.2 -> 21.08.3
kshisen: 21.08.2 -> 21.08.3
ksirk: 21.08.2 -> 21.08.3
ksmtp: 21.08.2 -> 21.08.3
ksnakeduel: 21.08.2 -> 21.08.3
kspaceduel: 21.08.2 -> 21.08.3
ksquares: 21.08.2 -> 21.08.3
ksudoku: 21.08.2 -> 21.08.3
ksystemlog: 21.08.2 -> 21.08.3
kteatime: 21.08.2 -> 21.08.3
ktimer: 21.08.2 -> 21.08.3
ktnef: 21.08.2 -> 21.08.3
ktuberling: 21.08.2 -> 21.08.3
kturtle: 21.08.2 -> 21.08.3
kubrick: 21.08.2 -> 21.08.3
kwalletmanager: 21.08.2 -> 21.08.3
kwordquiz: 21.08.2 -> 21.08.3
libcdr01: 0.1.7 -> 0.1.7_1
libe-book: 0.1.3_20 -> 0.1.3_21
libfreehand: 0.1.2_20 -> 0.1.2_21
libgpg-error: 1.42 -> 1.43
libgravatar: 21.08.2 -> 21.08.3
libical: 3.0.8_2 -> 3.0.8_3
libkcddb: 21.08.2 -> 21.08.3
libkcompactdisc: 21.08.2 -> 21.08.3
libkdcraw: 21.08.2 -> 21.08.3
libkdegames: 21.08.2 -> 21.08.3
libkdepim: 21.08.2 -> 21.08.3
libkeduvocdocument: 21.08.2 -> 21.08.3
libkexiv2: 21.08.2 -> 21.08.3
libkgapi: 21.08.2 -> 21.08.3
libkipi: 21.08.2 -> 21.08.3
libkleo: 21.08.2 -> 21.08.3
libkmahjongg: 21.08.2 -> 21.08.3
libksane: 21.08.2 -> 21.08.3
libksieve: 21.08.2 -> 21.08.3
libmspub01: 0.1.4_18 -> 0.1.4_19
libnghttp2: 1.45.1 -> 1.46.0
libphonenumber: 8.12.35 -> 8.12.36
libqalculate: 3.17.0_1 -> 3.17.0_2
libqxp: 0.0.0_18 -> 0.0.0_19
libreoffice: 7.2.2.2 -> 7.2.2.2_2
librsvg2-rust: 2.52.0 -> 2.52.3
libva: 2.13.0 -> 2.13.0_1
libvisio01: 0.1.7_4 -> 0.1.7_5
libxcvt: 0.1.0 -> 0.1.1
libzmf: 0.0.2_23 -> 0.0.2_24
llvm11: 11.0.1_2 -> 11.0.1_3
llvm12: 12.0.1_5 -> 12.0.1_6
lskat: 21.08.2 -> 21.08.3
mailcommon: 21.08.2 -> 21.08.3
mailimporter: 21.08.2 -> 21.08.3
marble: 21.08.2 -> 21.08.3
mbox-importer: 21.08.2 -> 21.08.3
messagelib: 21.08.2 -> 21.08.3
mod_php74: 7.4.24 -> 7.4.25
mpg123: 1.29.1 -> 1.29.2
mysql57-client: 5.7.35_1 -> 5.7.36
mysql57-server: 5.7.35 -> 5.7.36
nss: 3.71 -> 3.72
okular: 21.08.2_3 -> 21.08.3_4
openal-soft: 1.21.1_2 -> 1.21.1_3
openexr: 3.1.2 -> 3.1.3
openjdk11: 11.0.12+7.1_1 -> 11.0.13+8.1
openldap24-client: 2.4.59_2 -> 2.4.59_4
palapeli: 21.08.2 -> 21.08.3
parley: 21.08.2 -> 21.08.3
pciids: 20210930 -> 20211028
pcre2: 10.37 -> 10.39
php74: 7.4.24 -> 7.4.25
php74-ctype: 7.4.24 -> 7.4.25
php74-ftp: 7.4.24 -> 7.4.25
php74-mbstring: 7.4.24 -> 7.4.25
php74-pgsql: 7.4.24 -> 7.4.25
php74-session: 7.4.24 -> 7.4.25
php74-xml: 7.4.24 -> 7.4.25
picmi: 21.08.2 -> 21.08.3
pim-data-exporter: 21.08.2 -> 21.08.3
pim-sieve-editor: 21.08.2 -> 21.08.3
pimcommon: 21.08.2 -> 21.08.3
plasma-wayland-protocols: 1.4.0 -> 1.5.0
plasma5-breeze: 5.23.1 -> 5.23.2
plasma5-breeze-gtk: 5.23.1 -> 5.23.2
plasma5-discover: 5.23.1 -> 5.23.2
plasma5-drkonqi: 5.23.1 -> 5.23.2
plasma5-kactivitymanagerd: 5.23.1 -> 5.23.2
plasma5-kde-cli-tools: 5.23.1 -> 5.23.2
plasma5-kde-gtk-config: 5.23.1 -> 5.23.2
plasma5-kdecoration: 5.23.1 -> 5.23.2
plasma5-kdeplasma-addons: 5.23.1 -> 5.23.2
plasma5-kgamma5: 5.23.1 -> 5.23.2
plasma5-khotkeys: 5.23.1 -> 5.23.2
plasma5-kinfocenter: 5.23.1 -> 5.23.2
plasma5-kmenuedit: 5.23.1 -> 5.23.2
plasma5-kscreen: 5.23.1 -> 5.23.2
plasma5-kscreenlocker: 5.23.1 -> 5.23.2
plasma5-ksshaskpass: 5.23.1 -> 5.23.2
plasma5-ksystemstats: 5.23.1 -> 5.23.2
plasma5-kwallet-pam: 5.23.1 -> 5.23.2
plasma5-kwayland-integration: 5.23.1 -> 5.23.2
plasma5-kwayland-server: 5.23.1 -> 5.23.2
plasma5-kwin: 5.23.1 -> 5.23.2_1
plasma5-kwrited: 5.23.1 -> 5.23.2
plasma5-layer-shell-qt: 5.23.1 -> 5.23.2
plasma5-libkscreen: 5.23.1 -> 5.23.2
plasma5-libksysguard: 5.23.1 -> 5.23.2
plasma5-milou: 5.23.1 -> 5.23.2
plasma5-oxygen: 5.23.1 -> 5.23.2
plasma5-plasma: 5.23.1_1 -> 5.23.2
plasma5-plasma-browser-integration: 5.23.1 -> 5.23.2
plasma5-plasma-desktop: 5.23.1 -> 5.23.2.1
plasma5-plasma-disks: 5.23.1 -> 5.23.2
plasma5-plasma-integration: 5.23.1 -> 5.23.2
plasma5-plasma-pa: 5.23.1 -> 5.23.2
plasma5-plasma-sdk: 5.23.1 -> 5.23.2
plasma5-plasma-workspace: 5.23.1 -> 5.23.2
plasma5-plasma-workspace-wallpapers: 5.23.1 -> 5.23.2
plasma5-polkit-kde-agent-1: 5.23.1 -> 5.23.2
plasma5-powerdevil: 5.23.1 -> 5.23.2
plasma5-systemsettings: 5.23.1 -> 5.23.2
polkit: 0.119 -> 0.120
poppler: 21.10.0 -> 21.11.0
poppler-glib: 21.10.0 -> 21.11.0
poppler-qt5: 21.10.0 -> 21.11.0
poppler-utils: 21.10.0 -> 21.11.0
postgresql12-server: 12.8 -> 12.8_1
print-manager: 21.08.2 -> 21.08.3
py38-importlib-metadata: 4.7.1 -> 4.8.1
py38-numpy: 1.16.6_2,1 -> 1.20.3,1
qhull: 7.3.2_1,1 -> 7.3.2_2,1
qt5-core: 5.15.2_5 -> 5.15.2_6
qt5-webengine: 5.15.2_4 -> 5.15.2_5
qt5-webkit: 5.212.0.a4_6 -> 5.212.0.a4_7
qtkeychain: 0.12.0 -> 0.13.1
raptor2: 2.0.15_18 -> 2.0.15_19
rocs: 21.08.2 -> 21.08.3
samba412: 4.12.15_2 -> 4.12.15_3
shared-mime-info: 2.0_1 -> 2.0_2
signon-kwallet-extension: 21.08.2 -> 21.08.3
skanlite: 21.08.2 -> 21.08.3
smartmontools: 7.2_1 -> 7.2_2
spectacle: 21.08.2 -> 21.08.3
spidermonkey78: 78.9.0_1 -> 78.9.0_3
sqlite3: 3.35.5_3,1 -> 3.35.5_4,1
step: 21.08.2 -> 21.08.3
vim: 8.2.3458 -> 8.2.3570
vulkan-headers: 1.2.196 -> 1.2.197
x265: 3.4_1 -> 3.4_2
xwayland-devel: 21.0.99.1.106 -> 21.0.99.1.115

Installed packages to be REINSTALLED:
cups-filters-1.28.10_1 (needed shared library changed)
docbook-xml-5.0_3 (ABI changed: 'freebsd:13:x86:64' -> 'freebsd:13:*')
libavif-0.9.3 (needed shared library changed)

Number of packages to be installed: 2
Number of packages to be upgraded: 283
Number of packages to be reinstalled: 3

The process will require 36 MiB more space.
1 GiB to be downloaded.

Proceed with this action? [y/N]: n
root@plasma:~ # freebsd-version -kru
13.0-RELEASE-p4
13.0-RELEASE-p4
13.0-RELEASE-p5
root@plasma:~ # uname -a
FreeBSD plasma 13.0-RELEASE-p4 FreeBSD 13.0-RELEASE-p4 #0: Tue Aug 24 07:33:27 UTC 2021 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
root@plasma:~ # cat /usr/local/etc/pkg/repos/FreeBSD.conf
FreeBSD: {
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
}
root@plasma:~ #
 
Not even when 12 is no longer not required?

Re: the first image in the opening post, it's remarkable that neither line was an upgrade.
pkg leaf | grep postgres hits that package? Or a pkg autoremove would remove it?

And a computer cannot assume that "not needed by other packages" means "the user doesn't need and doesn't want it anymore". I would expect much more complains if it would be that way ;)

The v13 package is not an update to the v12; They are different packages which conflicts. If it would be an upgrade it would be simply replaced.

I don't know in which cases pkg suggests to remove other packages, but as long possible that should not happen; It is normal for users to clutter up their drives with packages that are no longer needed - this is where a pkg autoremove can help (but: never ever just execute it - read its output first!).

Vull Post #11: I see the normal suggestions of a pkg update - but not an upgrade of a major database version; Your old v12 packages wouldn't be replaced by v13.
 
I made no snapshots at VirtualBox or ZFS levels (sorry), so some relevant questions will be difficult or impossible for me to answer.

I raised an order-related question in #freebsd-bugs chat …
 
I don't recall using poudriere for anything that might have affected a PostgreSQL client. I might check history after completion of the second run of pkg upgrade -f -y but for now, the machine is not running (in a saved state).
 
Just put in make.conf,
Code:
DEFAULT_VERSIONS+=pgsql=13
It's not needed as PostgreSQL has been switched from 12 to 13 and it's used only when you build the ports not when you are installing via the pkg.

When you check the dependencies of pkg info -r postgresql12-client-12.8 this will show you which pkg are build against PostgreSQL12 and those pkg need to be rebuild using PORTS or you should wait until they are rebuild in the FreeBSD repository that you are using against PostgreSQL13.
 
...

Vull Post #11: I see the normal suggestions of a pkg update - but not an upgrade of a major database version; Your old v12 packages wouldn't be replaced by v13.
Perhaps I misunderstand your meaning, but pkg upgrade did in fact cause my old postgresql version 12 packages to be replaced with version 13. Here is the log I saved of my October 27 upgrade on a separate install of FreeBSD-13.0-RELEASE-p5. The main difference here, from the previous log I quoted, is that I answered "y"es to proceed when prompted. This install is now running version 13. If it had been an automated upgrade, the results would have been the same, and my PostgreSQL database would have likewise had to have been restored.
root@klatest:~ # freebsd-version -kru
13.0-RELEASE-p4
13.0-RELEASE-p4
13.0-RELEASE-p5
root@klatest:~ # cat /usr/local/etc/pkg/repos/FreeBSD.conf
FreeBSD: {
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
}
root@klatest:~ # uname -a
FreeBSD klatest 13.0-RELEASE-p4 FreeBSD 13.0-RELEASE-p4 #0: Tue Aug 24 07:33:27 UTC 2021 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
root@klatest:~ # cat pkg-upgrade2.txt #--- created with pkg upgrade | tee pkg-upgrade2.txt ---
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking for upgrades (23 candidates): .......... done
Processing candidates (23 candidates): .......... done
The following 24 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
postgresql13-client: 13.4


Installed packages to be UPGRADED:
exiv2: 0.27.4,1 -> 0.27.5,1
ffmpeg: 4.4_6,1 -> 4.4.1,1
firefox: 93.0_2,2 -> 93.0_3,2
librsvg2-rust: 2.52.0 -> 2.52.0_1
mod_php74: 7.4.24 -> 7.4.25
mpg123: 1.29.1 -> 1.29.2
openldap24-client: 2.4.59_2 -> 2.4.59_4
php74: 7.4.24 -> 7.4.25
php74-ctype: 7.4.24 -> 7.4.25
php74-ftp: 7.4.24 -> 7.4.25
php74-mbstring: 7.4.24 -> 7.4.25
php74-pgsql: 7.4.24 -> 7.4.25
php74-session: 7.4.24 -> 7.4.25
php74-xml: 7.4.24 -> 7.4.25
py38-numpy: 1.16.6_2,1 -> 1.20.3,1
qhull: 7.3.2_1,1 -> 7.3.2_2,1
spidermonkey78: 78.9.0_1 -> 78.9.0_2
xwayland-devel: 21.0.99.1.106 -> 21.0.99.1.111

Installed packages to be REINSTALLED:
cups-filters-1.28.10_1 (needed shared library changed)
gdal-3.3.2_2 (direct dependency changed: postgresql13-client)
kldap-21.08.2 (needed shared library changed)
libreoffice-7.2.2.2 (needed shared library changed)
samba412-4.12.15_2 (needed shared library changed)

Number of packages to be installed: 1
Number of packages to be upgraded: 18
Number of packages to be reinstalled: 5

The process will require 28 MiB more space.
255 MiB to be downloaded.

Proceed with this action? [y/N]: [1/24] Fetching xwayland-devel-21.0.99.1.111.pkg: .......... done
[2/24] Fetching spidermonkey78-78.9.0_2.pkg: .......... done
[3/24] Fetching samba412-4.12.15_2.pkg: .......... done
[4/24] Fetching qhull-7.3.2_2,1.pkg: .......... done
[5/24] Fetching py38-numpy-1.20.3,1.pkg: .......... done
[6/24] Fetching php74-xml-7.4.25.pkg: ... done
[7/24] Fetching php74-session-7.4.25.pkg: ..... done
[8/24] Fetching php74-pgsql-7.4.25.pkg: ...... done
[9/24] Fetching php74-mbstring-7.4.25.pkg: .......... done
[10/24] Fetching php74-ftp-7.4.25.pkg: ... done
[11/24] Fetching php74-ctype-7.4.25.pkg: . done
[12/24] Fetching php74-7.4.25.pkg: .......... done
[13/24] Fetching openldap24-client-2.4.59_4.pkg: .......... done
[14/24] Fetching mpg123-1.29.2.pkg: .......... done
[15/24] Fetching mod_php74-7.4.25.pkg: .......... done
[16/24] Fetching librsvg2-rust-2.52.0_1.pkg: .......... done
[17/24] Fetching libreoffice-7.2.2.2.pkg: .......... done
[18/24] Fetching kldap-21.08.2.pkg: .......... done
[19/24] Fetching gdal-3.3.2_2.pkg: .......... done
[20/24] Fetching firefox-93.0_3,2.pkg: .......... done
[21/24] Fetching ffmpeg-4.4.1,1.pkg: .......... done
[22/24] Fetching exiv2-0.27.5,1.pkg: .......... done
[23/24] Fetching cups-filters-1.28.10_1.pkg: .......... done
[24/24] Fetching postgresql13-client-13.4.pkg: .......... done
Checking integrity... done (2 conflicting)
- postgresql13-client-13.4 conflicts with postgresql12-client-12.8 on /usr/local/bin/clusterdb
- postgresql13-client-13.4 conflicts with postgresql12-client-12.8 on /usr/local/bin/clusterdb
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 26 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
postgresql12-client: 12.8
postgresql12-server: 12.8

New packages to be INSTALLED:
postgresql13-client: 13.4

Installed packages to be UPGRADED:
exiv2: 0.27.4,1 -> 0.27.5,1
ffmpeg: 4.4_6,1 -> 4.4.1,1
firefox: 93.0_2,2 -> 93.0_3,2
librsvg2-rust: 2.52.0 -> 2.52.0_1
mod_php74: 7.4.24 -> 7.4.25
mpg123: 1.29.1 -> 1.29.2
openldap24-client: 2.4.59_2 -> 2.4.59_4
php74: 7.4.24 -> 7.4.25
php74-ctype: 7.4.24 -> 7.4.25
php74-ftp: 7.4.24 -> 7.4.25
php74-mbstring: 7.4.24 -> 7.4.25
php74-pgsql: 7.4.24 -> 7.4.25
php74-session: 7.4.24 -> 7.4.25
php74-xml: 7.4.24 -> 7.4.25
py38-numpy: 1.16.6_2,1 -> 1.20.3,1
qhull: 7.3.2_1,1 -> 7.3.2_2,1
spidermonkey78: 78.9.0_1 -> 78.9.0_2
xwayland-devel: 21.0.99.1.106 -> 21.0.99.1.111

Installed packages to be REINSTALLED:
cups-filters-1.28.10_1 (needed shared library changed)
gdal-3.3.2_2 (direct dependency changed: postgresql13-client)
kldap-21.08.2 (needed shared library changed)
libreoffice-7.2.2.2 (needed shared library changed)
samba412-4.12.15_2 (needed shared library changed)

Number of packages to be removed: 2
Number of packages to be installed: 1
Number of packages to be upgraded: 18
Number of packages to be reinstalled: 5

The operation will free 25 MiB.

Proceed with this action? [y/N]: [1/26] Upgrading ffmpeg from 4.4_6,1 to 4.4.1,1...
[1/26] Extracting ffmpeg-4.4.1,1: .......... done
[2/26] Upgrading php74 from 7.4.24 to 7.4.25...
[2/26] Extracting php74-7.4.25: .......... done
[3/26] Upgrading qhull from 7.3.2_1,1 to 7.3.2_2,1...
[3/26] Extracting qhull-7.3.2_2,1: .......... done
[4/26] Deinstalling postgresql12-server-12.8...
[4/26] Deleting files for postgresql12-server-12.8: .......... done
==> You should manually remove the "postgres" user.
==> You should manually remove the "postgres" group
[5/26] Deinstalling postgresql12-client-12.8...
[5/26] Deleting files for postgresql12-client-12.8: .......... done

[6/26] Upgrading openldap24-client from 2.4.59_2 to 2.4.59_4...
[6/26] Extracting openldap24-client-2.4.59_4: .......... done
[7/26] Installing postgresql13-client-13.4...
[7/26] Extracting postgresql13-client-13.4: .......... done
[8/26] Upgrading spidermonkey78 from 78.9.0_1 to 78.9.0_2...
[8/26] Extracting spidermonkey78-78.9.0_2: .......... done
[9/26] Upgrading librsvg2-rust from 2.52.0 to 2.52.0_1...
[9/26] Extracting librsvg2-rust-2.52.0_1: .......... done
[10/26] Upgrading xwayland-devel from 21.0.99.1.106 to 21.0.99.1.111...
[10/26] Extracting xwayland-devel-21.0.99.1.111: ...... done
[11/26] Reinstalling samba412-4.12.15_2...
[11/26] Extracting samba412-4.12.15_2: .......... done
[12/26] Upgrading py38-numpy from 1.16.6_2,1 to 1.20.3,1...
[12/26] Extracting py38-numpy-1.20.3,1: .......... done
[13/26] Upgrading php74-xml from 7.4.24 to 7.4.25...
[13/26] Extracting php74-xml-7.4.25: ........ done
[14/26] Upgrading php74-session from 7.4.24 to 7.4.25...
[14/26] Extracting php74-session-7.4.25: .......... done
[15/26] Upgrading php74-pgsql from 7.4.24 to 7.4.25...
[15/26] Extracting php74-pgsql-7.4.25: ....... done
[16/26] Upgrading php74-mbstring from 7.4.24 to 7.4.25...
[16/26] Extracting php74-mbstring-7.4.25: .......... done
[17/26] Upgrading php74-ftp from 7.4.24 to 7.4.25...
[17/26] Extracting php74-ftp-7.4.25: ........ done
[18/26] Upgrading php74-ctype from 7.4.24 to 7.4.25...
[18/26] Extracting php74-ctype-7.4.25: ....... done
[19/26] Upgrading mpg123 from 1.29.1 to 1.29.2...
[19/26] Extracting mpg123-1.29.2: .......... done
[20/26] Upgrading mod_php74 from 7.4.24 to 7.4.25...
[20/26] Extracting mod_php74-7.4.25: .... done
[21/26] Reinstalling libreoffice-7.2.2.2...
[21/26] Extracting libreoffice-7.2.2.2: .......... done
[22/26] Reinstalling kldap-21.08.2...
[22/26] Extracting kldap-21.08.2: .......... done
[23/26] Reinstalling gdal-3.3.2_2...
[23/26] Extracting gdal-3.3.2_2: .......... done
[24/26] Upgrading firefox from 93.0_2,2 to 93.0_3,2...
[24/26] Extracting firefox-93.0_3,2: .......... done
[25/26] Upgrading exiv2 from 0.27.4,1 to 0.27.5,1...
[25/26] Extracting exiv2-0.27.5,1: .......... done
[26/26] Reinstalling cups-filters-1.28.10_1...
[26/26] Extracting cups-filters-1.28.10_1: .......... done
Generating GTK icon cache for /usr/local/share/icons/hicolor
Building the Shared MIME-Info database cache
=====
Message from postgresql13-client-13.4:

--
The PostgreSQL port has a collection of "side orders":

postgresql-docs
For all of the html documentation

p5-Pg
A perl5 API for client access to PostgreSQL databases.

postgresql-tcltk
If you want tcl/tk client support.

postgresql-jdbc
For Java JDBC support.

postgresql-odbc
For client access from unix applications using ODBC as access
method. Not needed to access unix PostgreSQL servers from Win32
using ODBC. See below.

ruby-postgres, py-psycopg2
For client access to PostgreSQL databases using the ruby & python
languages.

postgresql-plperl, postgresql-pltcl & postgresql-plruby
For using perl5, tcl & ruby as procedural languages.

postgresql-contrib
Lots of contributed utilities, postgresql functions and
datatypes. There you find pg_standby, pgcrypto and many other cool
things.

etc...
root@klatest:~ # pkg info -E pkg
pkg-1.17.3
root@klatest:~ # pkg info -E postgresql13-client
postgresql13-client-13.4
root@klatest:~ # pkg info -E postgresql13-server
postgresql13-server-13.4_1
root@klatest:~ #

Please note that this upgrade did NOT replace postgresql12-server with postgresql13-server after removing the version 12 server package.

To the contrary, I had to manually install the server, with pkg install postgresql13-server, and then restore the postgresql database with an SQL backup file... and, for those in the back, this is an example of why we make backups before we upgrade things.
 
My scrollback (at ttyv1) didn't allow me to see enough of what preceded the incomplete first run.

This makes perfect sense (removals, installation):

Code:
…
[24/24] Fetching postgresql13-client-13.4.pkg: .......... done
Checking integrity... done (2 conflicting)
- postgresql13-client-13.4 conflicts with postgresql12-client-12.8 on /usr/local/bin/clusterdb
- postgresql13-client-13.4 conflicts with postgresql12-client-12.8 on /usr/local/bin/clusterdb
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 26 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
postgresql12-client: 12.8
postgresql12-server: 12.8

New packages to be INSTALLED:
postgresql13-client: 13.4

…

[4/26] Deinstalling postgresql12-server-12.8...
[4/26] Deleting files for postgresql12-server-12.8: .......... done
==> You should manually remove the "postgres" user.
==> You should manually remove the "postgres" group
[5/26] Deinstalling postgresql12-client-12.8...
[5/26] Deleting files for postgresql12-client-12.8: .......... done
…
[7/26] Installing postgresql13-client-13.4...
[7/26] Extracting postgresql13-client-13.4: .......... done
[8/26] Upgrading spidermonkey78 from 78.9.0_1 to 78.9.0_2...
[8/26] Extracting spidermonkey78-78.9.0_2: .......... done
…
  • 7 of 26 was the superior client
  • 8 of 26 was not immediately subsequent installation of the inferior client.
 
Back
Top