pkg(8) fails to upgrade to different branches of software

Ben Woods woodsb02 at gmail.com
Sun Jun 25 02:54:13 UTC 2017


Hi everyone,

The recent change of postgresql default version from 9.3 to 9.5 in r444116
required pkg to replace any postgresql93-* packages with postgresql95-*
packages, and also reinstall any ports which changed their dependency from
the 93 version to the 95 version.

This did not succeed automatically with "pkg upgrade -y" as can be seen
below. I realise the UPDATING entry explained to first remove the old
packages and then install the new packages, but I would like to ask if
there is a way this can be improved so it works automatically, and if there
is a plan in place to improve this?

This problem appears to have 2 issues:
1. pkg is not recognising the CONFLICTS when initially determining the
upgrade path (they are specified in the master port
databases/postgresql92-server/Makefile)
2. once the packages have been fetched and pkg notices the file conflict,
the solver does not decide to remove the pkg with the lower version

# pkg upgrade -y
    Updating FreeBSD-ports repository catalogue...
    FreeBSD-ports repository is up to date.
    All repositories are up to date.
    Checking for upgrades (8 candidates): ........ done
    Processing candidates (8 candidates): ........
done
    The following 9 package(s) will be affected (of 0
checked):

    New packages to be INSTALLED:
        postgresql95-client: 9.5.7 [FreeBSD-ports]

    Installed packages to be UPGRADED:
        vim: 8.0.0642 -> 8.0.0670 [FreeBSD-ports]
        qt5-script: 5.7.1_1 -> 5.7.1_2 [FreeBSD-ports]
        llvm40: 4.0.1.r1_5 -> 4.0.1 [FreeBSD-ports]
        libreoffice: 5.3.3_2 -> 5.3.4 [FreeBSD-ports]
        gutenprint: 5.2.12_1 -> 5.2.12_2 [FreeBSD-ports]
        freebsd-release-manifests: 20170617 -> 20170624 [FreeBSD-ports]

    Installed packages to be REINSTALLED:
        rubygem-pg-0.21.0 [FreeBSD-ports] (direct dependency changed:
postgresql95-client)
        gimp-gutenprint-5.2.12 [FreeBSD-ports] (direct dependency changed:
perl5)

    Number of packages to be installed: 1
    Number of packages to be upgraded: 6
    Number of packages to be reinstalled: 2

    The process will require 10 MiB more space.
    370 MiB to be downloaded.
    [1/9] Fetching vim-8.0.0670.txz: .......... done
    [2/9] Fetching rubygem-pg-0.21.0.txz: .......... done
    [3/9] Fetching qt5-script-5.7.1_2.txz: .......... done
    [4/9] Fetching llvm40-4.0.1.txz: .......... done
    [5/9] Fetching libreoffice-5.3.4.txz: .......... done
    [6/9] Fetching gutenprint-5.2.12_2.txz: .......... done
    [7/9] Fetching gimp-gutenprint-5.2.12.txz: .......... done
    [8/9] Fetching freebsd-release-manifests-20170624.txz: ... done
    [9/9] Fetching postgresql95-client-9.5.7.txz: .......... done
    Checking integrity... done (1 conflicting)
      - postgresql95-client-9.5.7 [FreeBSD-ports] conflicts with
postgresql93-client-9.3.17 [installed] 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 12 package(s) will be affected (of 0 checked):

    New packages to be INSTALLED:
        postgresql95-client: 9.5.7 [FreeBSD-ports]

    Installed packages to be UPGRADED:
        gutenprint: 5.2.12_1 -> 5.2.12_2 [FreeBSD-ports]
        vim: 8.0.0642 -> 8.0.0670 [FreeBSD-ports]
        qt5-script: 5.7.1_1 -> 5.7.1_2 [FreeBSD-ports]
        llvm40: 4.0.1.r1_5 -> 4.0.1 [FreeBSD-ports]
        libreoffice: 5.3.3_2 -> 5.3.4 [FreeBSD-ports]
        freebsd-release-manifests: 20170617 -> 20170624 [FreeBSD-ports]

    Installed packages to be REINSTALLED:
        pkg-1.10.1 [FreeBSD-ports]
        rubygem-pg-0.21.0 [FreeBSD-ports] (direct dependency changed:
postgresql95-client)
        gimp-gutenprint-5.2.12 [FreeBSD-ports] (direct dependency changed:
perl5)

    Number of packages to be installed: 1
    Number of packages to be upgraded: 6
    Number of packages to be reinstalled: 3

    The process will require 10 MiB more space.
    3 MiB to be downloaded.
    [1/12] Fetching pkg-1.10.1.txz: .......... done
    [1/12] Fetching postgresql93-client-9.3.17.txz: .......... done
    [1/12] Deinstalling postgresql93-client-9.3.17...
    Deleting files for postgresql93-client-9.3.17: .......... done
    [1/12] Upgrading gutenprint from 5.2.12_1 to
5.2.12_2...

    Extracting gutenprint-5.2.12_2: .......... done
    [1/12] Installing postgresql95-client-9.5.7...
    Extracting postgresql95-client-9.5.7: .......... done
    Installing postgresql93-client-9.3.17...
    pkg: postgresql93-client-9.3.17 conflicts with
postgresql95-client-9.5.7 (installs files into the same place).
Problematic file: /usr/local/bin/clusterdb



Note that this appears to effectively remove the old postgresql93-client
port, so a subsequent pkg run succeeds:

# pkg info | grep postgres
postgresql95-client-9.5.7      PostgreSQL database (client)
rubygem-postgres_ext-3.0.0     PostgreSQL data types extension for
ActiveRecord
# pkg upgrade
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
All repositories are up to date.
Checking for upgrades (7 candidates): 100%
Processing candidates (7 candidates): 100%
Checking integrity... done (0 conflicting)
The following 7 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
        vim: 8.0.0642 -> 8.0.0670 [FreeBSD-ports]
        qt5-script: 5.7.1_1 -> 5.7.1_2 [FreeBSD-ports]
        llvm40: 4.0.1.r1_5 -> 4.0.1 [FreeBSD-ports]
        libreoffice: 5.3.3_2 -> 5.3.4 [FreeBSD-ports]
        freebsd-release-manifests: 20170617 -> 20170624 [FreeBSD-ports]

Installed packages to be REINSTALLED:
        rubygem-pg-0.21.0 [FreeBSD-ports] (direct dependency changed:
postgresql95-client)
        gimp-gutenprint-5.2.12 [FreeBSD-ports] (direct dependency changed:
perl5)

Number of packages to be upgraded: 5
Number of packages to be reinstalled: 2

Proceed with this action? [y/N]: y
[1/7] Upgrading vim from 8.0.0642 to 8.0.0670...
[1/7] Extracting vim-8.0.0670: 100%
You may need to manually remove /usr/local/etc/vim/vimrc if it is no longer
needed.
[2/7] Reinstalling rubygem-pg-0.21.0...
[2/7] Extracting rubygem-pg-0.21.0: 100%
[3/7] Upgrading qt5-script from 5.7.1_1 to 5.7.1_2...
[3/7] Extracting qt5-script-5.7.1_2: 100%
[4/7] Upgrading llvm40 from 4.0.1.r1_5 to 4.0.1...
[4/7] Extracting llvm40-4.0.1: 100%
[5/7] Upgrading libreoffice from 5.3.3_2 to 5.3.4...
[5/7] Extracting libreoffice-5.3.4: 100%
[6/7] Reinstalling gimp-gutenprint-5.2.12...
[6/7] Extracting gimp-gutenprint-5.2.12: 100%
[7/7] Upgrading freebsd-release-manifests from 20170617 to 20170624...
[7/7] Extracting freebsd-release-manifests-20170624: 100%
#

Regards,
Ben

--
From: Benjamin Woods
woodsb02 at gmail.com


More information about the freebsd-ports mailing list