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



## grahamperrin@ (Nov 13, 2021)

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.




Should I report a bug?

If so: where (against which port)?

The subsequent run also stopped:




```
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:



FreeBSD 13.0-RELEASE-p5 userland.


----------



## VladiBG (Nov 13, 2021)

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




			https://github.com/freebsd/freebsd-ports/blob/main/UPDATING
		


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
> ...



Here's upgrading from postgresql10.17-client/server -> version 13


> su
> service postgresql stop
> cd /root
> pkg create postgresql10-server
> ...


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
> ...


/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


----------



## grahamperrin@ (Nov 13, 2021)

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.


```
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:~ #
```


```
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:~ #
```


```
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
```


----------



## VladiBG (Nov 13, 2021)

Did you check which pkg requires postgresql12-client?


----------



## grahamperrin@ (Nov 13, 2021)

VladiBG said:


> 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): 


```
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:~ #
```


----------



## Vull (Nov 13, 2021)

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:
	
	



```
$ 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.


----------



## grahamperrin@ (Nov 13, 2021)

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.



Vull said:


> … guessing that you also have pkg-1.17.4 …



True;


```
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:~ %
```


----------



## grahamperrin@ (Nov 13, 2021)

For reference only (not seeking support):



grahamperrin said:


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




```
…
[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:~ #
```


```
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:~ #
```


```
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: 









						Citrix Receiver (net/citrix_ica)
					

net/citrix_ica  Is anyone using this without difficulty?  For me, most things become almost completely non-responsive immediately after the application starts.  Whilst the content of the Ctirix Receiver window appears to be frozen, if untouched, I can force momentary refreshes by repeatedly...




					forums.freebsd.org


----------



## jmos (Nov 13, 2021)

grahamperrin said:


> 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.


----------



## grahamperrin@ (Nov 13, 2021)

jmos said:


> 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*.


----------



## Vull (Nov 13, 2021)

jmos said:


> 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*
> ...


----------



## jmos (Nov 13, 2021)

grahamperrin said:


> 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.


----------



## grahamperrin@ (Nov 13, 2021)

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 …


----------



## Alain De Vos (Nov 13, 2021)

Just put in make.conf,

```
DEFAULT_VERSIONS+=pgsql=13
```


----------



## grahamperrin@ (Nov 13, 2021)

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).


----------



## VladiBG (Nov 13, 2021)

Alain De Vos said:


> Just put in make.conf,
> 
> ```
> 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 (Nov 13, 2021)

jmos said:


> ...
> 
> 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
> ...



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.


----------



## grahamperrin@ (Nov 13, 2021)

My scrollback (at ttyv1) didn't allow me to see enough of what preceded the incomplete first run. 

This makes perfect sense (removals, installation): 



Vull said:


> ```
> …
> [24/24] Fetching postgresql13-client-13.4.pkg: .......... done
> Checking integrity... done (2 conflicting)
> ...



7 of 26 was the superior client
8 of 26 was *not *immediately subsequent installation of the inferior client.


----------

