Bad upgrade behaviour with 1.4.0
Matthew Seaman
matthew at FreeBSD.org
Sun Dec 14 13:29:20 UTC 2014
On 14/12/2014 06:18, Darren Pilgrim wrote:
> # pkg upgrade php5-pgsql
> Updating FreeBSD repository catalogue...
> FreeBSD repository is up-to-date.
> All repositories are up-to-date.
>
> nginx-1.6.2_1,2 is locked and may not be modified
>
> openssh-portable-6.7.p1,1 is locked and may not be modified
>
> dovecot2-2.2.15_1 is locked and may not be modified
>
> dovecot-pigeonhole-0.4.6 is locked and may not be modified
>
> postfix-2.11.3_3,1 is locked and may not be modified
>
> postgresql92-server-9.2.9_1 is locked and may not be modified
> Checking integrity... done (1 conflicting)
> Checking integrity... done (0 conflicting)
> The following 7 packages will be affected (of 0 checked):
>
> Installed packages to be REMOVED:
> postgresql92-client-9.2.9_1
> dovecot2-2.2.15_1
> dovecot-pigeonhole-0.4.6
> postfix-2.11.3_3,1
> postgresql92-server-9.2.9_1
>
> New packages to be INSTALLED:
> postgresql93-client: 9.3.5
>
> Installed packages to be REINSTALLED:
> php5-pgsql-5.4.35 (direct dependency changed)
>
> The operation will free 46 MB.
>
> Proceed with this action? [y/N]: n
>
> The reasoning here is fairly obvious: it's going to replace the
> postgresql client with a new version, and you can't have more than one
> version of the client installed, so it needs to delete
> postgresql92-client. I guess the public repo bumped the postgresql
> version used.
>
> I keep dovecot2, postfix and several other ports locked because I build
> them from ports due to needing non-default options. In prior versions
> of pkg, this worked fine: pkg would complain about the lock, but an
> upgrade would carry on ignoring the locked ports.
>
> But pkg 1.4.0 doesn't. It ignores the lock and tries to delete those
> package anyway, making the upgrade process fail outright.
>
> If I unlock everything, I still get broken behaviour:
>
> # pkg upgrade php5-pgsql
> Updating FreeBSD repository catalogue...
> FreeBSD repository is up-to-date.
> All repositories are up-to-date.
> Checking integrity... done (1 conflicting)
> Checking integrity...pkg: cannot load files from dovecot2 to check
> integrity
> done (0 conflicting)
> The following 6 packages will be affected (of 0 checked):
>
> Installed packages to be REMOVED:
> postgresql92-client-9.2.9_1
> postfix-2.11.3_3,1
> postgresql92-server-9.2.9_1
>
> New packages to be INSTALLED:
> postgresql93-client: 9.3.5
>
> Installed packages to be REINSTALLED:
> php5-pgsql-5.4.35 (direct dependency changed)
> dovecot2-2.2.15_1 (options changed)
>
> The operation will free 29 MB.
> 3 MB to be downloaded.
>
> Proceed with this action? [y/N]:
>
> Here it wants to upgrade dovecot, but not postfix, which is really bizarre.
>
> There's nothing in UPDATING about this.
>
> How do I upgrade php5-pgsql and the postgresql client?
The default postgresql client in the public repositories is postgresql92
-- any reference to postgresql93 must be due to locally compiled packages.
Yes, this is buggy behaviour by pkg(8) -- it works very well when all
your packages come from a single repository, but can have problems if
you configure multiple repositories or (apparently) mix locally compiled
ports and the main FreeBSD repositories.
Assuming that you want Postgresql 92 rather than 93, then you can:
# pkg fetch php5-pgsql
# pkg add /var/cache/pkg/php5-pgsql-5.4.35.txz
(Note this will also install any dependencies it needs if the files are
present in /var/cache/pkg)
If you want to use postgresql93-client then you're going to have to
build your own packages of anything that has a direct dependency on
postgresql client. That generally equates to anything that includes
binaries linked against libpq.so.X.Y.Z, which here would include
php5-pgsql and also postfix and dovecot given you've selected the
options that enable that. Nowadays you can 'make package' and then 'pkg
add' the result, but you'ld have to sort out the dependencies manually.
Instead, I'd recommend setting up your own poudriere instance to build
your locally customized ports: it is really much the easiest and
cleanest approach even if you've only got one machine to maintain.
Note bug #1094 (https://github.com/freebsd/pkg/issues/1094) with
multiple repositories though -- this will occur even if everything is up
to date. (In which case, just press 'N' when pkg upgrade asks if you
want to proceed.) Despite this, pkg-1.4.0 does contain some useful
fixes for multirepo usage, including restoring the priority ordering of
repositories based on the ordering of /usr/local/etc/pkg/repos/*.conf
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 971 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-pkg/attachments/20141214/40bcbfe7/attachment.sig>
More information about the freebsd-pkg
mailing list