• pkg upgrade forgot how to upgrade packages?

    From Miroslav Lachman@000.fbsd@quip.cz to muc.lists.freebsd.ports on Thu Oct 9 13:09:29 2025
    From Newsgroup: muc.lists.freebsd.ports

    The update process works the same as before, but in the log files it
    looks like "pkg upgrade" can't distinguish between updating packages and simply installing new ones.

    If I remember it correctly, pkg logs events in to messages, but I have
    it configured in syslog.conf to log into separate pkg.log. In the past
    (for many years) it was logging like this:

    # grep mariadb /var/log/pkg.log
    Jan 22 21:48:42 host1 pkg[4859]: mariadb106-client upgraded: 10.6.19 -> 10.6.20
    Jan 22 21:57:54 host1 pkg[4859]: mariadb106-server upgraded: 10.6.19 -> 10.6.20
    Mar 26 21:40:11 host1 pkg[86634]: mariadb106-client upgraded: 10.6.20 -> 10.6.21
    Mar 26 21:41:02 host1 pkg[86634]: mariadb106-server upgraded: 10.6.20 -> 10.6.21

    But there are almost no "upgraded" messages for the last 6 months. I say "almost" because there are few of the for some packages.

    Upgrade of MariaDB looks like this now:

    Oct 8 21:14:29 host1 pkg[9522]: mariadb1011-server-10.11.13 deinstalled
    Oct 8 21:14:45 host1 pkg[9522]: mariadb1011-client-10.11.13 deinstalled
    Oct 8 21:18:37 host1 pkg[9522]: mariadb1011-client-10.11.13_1 installed
    Oct 8 21:19:01 host1 pkg[9522]: mariadb1011-server-10.11.13_1 installed

    16 "upgraded" messages out of 213 messages in total:

    Oct 8 21:14:05 host1 pkg[9492]: pkg upgraded: 2.2.0 -> 2.2.2
    Oct 8 21:14:52 host1 pkg[9522]: apr upgraded: 1.7.5.1.6.3_4 ->
    1.7.5.1.6.3_5
    Oct 8 21:14:54 host1 pkg[9522]: easy-rsa upgraded: 3.2.2,1 -> 3.2.3,1
    Oct 8 21:14:54 host1 pkg[9522]: gdbm upgraded: 1.24 -> 1.25
    Oct 8 21:15:03 host1 pkg[9522]: git upgraded: 2.49.0 -> 2.51.0
    Oct 8 21:15:03 host1 pkg[9522]: libdeflate upgraded: 1.22 -> 1.24
    Oct 8 21:15:03 host1 pkg[9522]: libffi upgraded: 3.4.6 -> 3.5.1
    Oct 8 21:15:04 host1 pkg[9522]: libgpg-error upgraded: 1.51 -> 1.55
    Oct 8 21:15:04 host1 pkg[9522]: libnghttp2 upgraded: 1.65.0 -> 1.66.0
    Oct 8 21:15:04 host1 pkg[9522]: libogg upgraded: 1.3.5,4 -> 1.3.6,4
    Oct 8 21:15:04 host1 pkg[9522]: mpdecimal upgraded: 4.0.0 -> 4.0.1
    Oct 8 21:15:06 host1 pkg[9522]: nettle upgraded: 3.10.1 -> 3.10.2
    Oct 8 21:15:06 host1 pkg[9522]: openjph upgraded: 0.21.2 -> 0.21.3
    Oct 8 21:15:17 host1 pkg[9522]: screen upgraded: 5.0.1_3 -> 5.0.1_4
    Oct 8 21:15:18 host1 pkg[9522]: sqlite3 upgraded: 3.46.1_1,1 -> 3.50.2_1,1
    Oct 8 21:15:19 host1 pkg[9522]: sudo upgraded: 1.9.17p1 -> 1.9.17p2

    And it's not just about MariaDB, it's a simple example. Another huge
    example can be PHP - all extensions were previously logged as "upgraded"
    and now they all are "deinstalled" and "installed".

    What was changed and is there some way to log the pkg upgrade events
    like it was before?

    We are using this logged events to have some overview about what
    packages were installed as new dependencies of existing packages and so on.

    I know it was not perfect even before so I made some homegrown script to
    track these changes but I still think it would be better if these events
    will be correctly logged by the pkg itself if the pkg has all the
    knowledge what is installed before upgrade, what has to be upgraded and
    what has to be installed as new dependency.

    Kind regards
    Miroslav Lachman



    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Miroslav Lachman@000.fbsd@quip.cz to muc.lists.freebsd.ports on Thu Oct 9 13:59:07 2025
    From Newsgroup: muc.lists.freebsd.ports

    On 09/10/2025 13:22, David Wolfskill wrote:
    On Thu, Oct 09, 2025 at 01:09:29PM +0200, Miroslav Lachman wrote:
    The update process works the same as before, but in the log files it looks >> like "pkg upgrade" can't distinguish between updating packages and simply
    installing new ones.
    ....

    I don't know a lot about the "internal workings" of pkg, but I do use it
    (as I update systems "frequently").

    This example may be "interesting," as it shows mostly "upgraded," but in
    one case (clamav), it shows a deinstall/install pair:

    Oct 5 11:09:48 bats pkg[1831]: ca_root_nss upgraded: 3.115_2 -> 3.115_3
    Oct 5 11:09:48 bats pkg[1831]: libunistring upgraded: 1.3 -> 1.4
    Oct 5 11:09:51 bats pkg[1831]: pango upgraded: 1.56.1 -> 1.56.4
    Oct 5 11:09:52 bats pkg[1831]: tiff upgraded: 4.7.0 -> 4.7.1
    Oct 5 11:09:52 bats pkg[1831]: clamav-1.4.3_1,1 deinstalled
    Oct 5 11:09:54 bats pkg[1831]: curl upgraded: 8.15.0 -> 8.16.0
    Oct 5 11:09:54 bats pkg[1831]: pcre2 upgraded: 10.45_1 -> 10.46
    Oct 5 11:09:55 bats pkg[1831]: clamav-1.4.3_2,1 installed


    Now I tried to compare more machines and the strange thing is, that
    sometimes it shows "upgraded" even in the last months and sometimes not.
    On the host2 at 2025-07-03 the PHP is logged as upgraded, at 2025-08-26
    almost everything is deinstalled and installed, then at 2025-09-29
    upgraded. Behavior is not consistent across all the machines but is was
    more "upgraded" on all machines in the past. (just comparing numbers of
    logged events "installed" / "deinstalled" / "upgraded" in the log files
    from previous years)

    examples from this year from 2 hosts

    host1
    https://defuse.ca/b/rVbAE8WaLJ0WkDnwJxtn77

    host2 (rfc5424 log format)
    https://defuse.ca/b/4CESdSDzkxhwngVLsl7Fe9

    Kind regards
    Miroslav Lachman



    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Mark Millard@marklmi@yahoo.com to muc.lists.freebsd.ports on Thu Oct 9 09:47:29 2025
    From Newsgroup: muc.lists.freebsd.ports

    Miroslav Lachman <000.fbsd_at_quip.cz> wrote on
    Date: Thu, 09 Oct 2025 11:09:29 UTC :
    The update process works the same as before, but in the log files it > looks like "pkg upgrade" can't distinguish between updating packages and
    simply installing new ones.

    If I remember it correctly, pkg logs events in to messages, but I have
    it configured in syslog.conf to log into separate pkg.log. In the past > (for many years) it was logging like this:

    # grep mariadb /var/log/pkg.log
    Jan 22 21:48:42 host1 pkg[4859]: mariadb106-client upgraded: 10.6.19 -> 10.6.20
    Jan 22 21:57:54 host1 pkg[4859]: mariadb106-server upgraded: 10.6.19 -> 10.6.20
    Mar 26 21:40:11 host1 pkg[86634]: mariadb106-client upgraded: 10.6.20 -> 10.6.21
    Mar 26 21:41:02 host1 pkg[86634]: mariadb106-server upgraded: 10.6.20 -> 10.6.21

    But there are almost no "upgraded" messages for the last 6 months. I say "almost" because there are few of the for some packages.

    Upgrade of MariaDB looks like this now:

    Oct 8 21:14:29 host1 pkg[9522]: mariadb1011-server-10.11.13 deinstalled
    Oct 8 21:14:45 host1 pkg[9522]: mariadb1011-client-10.11.13 deinstalled
    Oct 8 21:18:37 host1 pkg[9522]: mariadb1011-client-10.11.13_1 installed
    Oct 8 21:19:01 host1 pkg[9522]: mariadb1011-server-10.11.13_1 installed
    Note the time frames between deinstall and install:
    00:04:31 for mariadb1011-server
    00:03:52 for mariadb1011-client
    Also note the order of the operations: mariadb1011-client
    has both activities happen while mariadb1011-server is
    not installed.
    You appear to have omitted any reference other activity
    during those minutes.
    16 "upgraded" messages out of 213 messages in total:

    Oct 8 21:14:05 host1 pkg[9492]: pkg upgraded: 2.2.0 -> 2.2.2
    Oct 8 21:14:52 host1 pkg[9522]: apr upgraded: 1.7.5.1.6.3_4 ->
    1.7.5.1.6.3_5
    Oct 8 21:14:54 host1 pkg[9522]: easy-rsa upgraded: 3.2.2,1 -> 3.2.3,1
    Oct 8 21:14:54 host1 pkg[9522]: gdbm upgraded: 1.24 -> 1.25
    Oct 8 21:15:03 host1 pkg[9522]: git upgraded: 2.49.0 -> 2.51.0
    Oct 8 21:15:03 host1 pkg[9522]: libdeflate upgraded: 1.22 -> 1.24
    Oct 8 21:15:03 host1 pkg[9522]: libffi upgraded: 3.4.6 -> 3.5.1
    Oct 8 21:15:04 host1 pkg[9522]: libgpg-error upgraded: 1.51 -> 1.55
    Oct 8 21:15:04 host1 pkg[9522]: libnghttp2 upgraded: 1.65.0 -> 1.66.0
    Oct 8 21:15:04 host1 pkg[9522]: libogg upgraded: 1.3.5,4 -> 1.3.6,4
    Oct 8 21:15:04 host1 pkg[9522]: mpdecimal upgraded: 4.0.0 -> 4.0.1
    Oct 8 21:15:06 host1 pkg[9522]: nettle upgraded: 3.10.1 -> 3.10.2
    Oct 8 21:15:06 host1 pkg[9522]: openjph upgraded: 0.21.2 -> 0.21.3
    Oct 8 21:15:17 host1 pkg[9522]: screen upgraded: 5.0.1_3 -> 5.0.1_4
    Oct 8 21:15:18 host1 pkg[9522]: sqlite3 upgraded: 3.46.1_1,1 -> 3.50.2_1,1 Oct 8 21:15:19 host1 pkg[9522]: sudo upgraded: 1.9.17p1 -> 1.9.17p2
    As I understand, these message are a shorter form for when
    the deinstall and install for a specific package happen
    back-to-back with no other activity between them.
    A simple illustration of the distinction for back-to-back
    vs. not happening, with reinstall activity instead of upgrade
    activity is:
    Oct 4 16:26:32 7950X3D-ZFS pkg-static[6863]: python-3.11_3,2 deinstalled
    Oct 4 16:26:32 7950X3D-ZFS pkg-static[6863]: python3 reinstalled: 3_4 -> 3_4 Oct 4 16:26:32 7950X3D-ZFS pkg-static[6863]: python-3.11_3,2 installed
    And it's not just about MariaDB, it's a simple example. Another huge > example can be PHP - all extensions were previously logged as "upgraded"
    and now they all are "deinstalled" and "installed".

    What was changed
    The order of the operations, possibly due to tracking dependency
    ordering better or some such. Tying to be able to also handle
    system upgrades as well to make pkgbase work appropriately
    likely changed the detailed criteria to be met for
    deinstallation and installation ordering.
    In general there are contexts for which:
    ) something should be deinstalled before deinstallation of what
    it depends on (transitive closure involved)
    ) something should be installed after installing what it depends
    on (transitive closure involved)
    This is true for both upgrades and for re-installations.
    and is there some way to log the pkg upgrade events
    like it was before?
    My guess is that more likely would be having messages that
    instead say something indicating more, like suggested by:
    deinstalled for upgrade
    installed the upgrade
    deinstallation for re-installation
    installed the re-installation
    deinstalled for deletion
    installed the additional software
    But such is just a guess and I've no clue if such would be
    reasonable or be justified for the effort by the amount of
    use of the extra text.
    . . .
    ===
    Mark Millard
    marklmi at yahoo.com
    --
    Posted automagically by a mail2news gateway at muc.de e.V.
    Please direct questions, flames, donations, etc. to news-admin@muc.de
    --- Synchronet 3.21a-Linux NewsLink 1.2