Update deprecated ports

Greetings all.
I'm newbie to FreeBSD.
Sorry for my English, it's not native.

I am using FreeBSD 13.4-RELEASE-p3 GENERIC and portmaster for updating ports.
I need to update the zabbix6-agent-6.0.26 port
Code:
sudo portmaster -Hd zabbix6-agent-\*

===>>> zabbix6-agent-6.0.26 >> (15)

===>>> The following actions will be taken if you choose to proceed:
Upgrade zabbix6-agent-6.0.26 to zabbix6-agent-6.0.39
Upgrade libxml2-2.11.6 to libxml2-2.11.9
Upgrade cmake-core-3.28.3 to cmake-core-3.31.6
Upgrade jsoncpp-1.9.5 to jsoncpp-1.9.6_1
Upgrade meson-1.3.1_1 to meson-1.7.0
Upgrade ninja-1.11.1,2 to ninja-1.11.1,4
Upgrade python39-3.9.21 to python39-3.9.22
Upgrade libffi-3.4.6 to libffi-3.4.7
Install devel/py-build@py39
Install devel/py-pyproject-hooks@py39
Upgrade py39-tomli-2.0.1_2 to py39-tomli-2.1.0
Upgrade py39-setuptools-63.1.0_2 to py39-setuptools-63.1.0_3
Upgrade py39-wheel-0.42.0 to py39-wheel-0.45.1
Upgrade libuv-1.48.0 to libuv-1.50.0
Install dns/libidn2
Install devel/libunistring

===>>> Proceed? y/n [y] y

But the update ends with an installation error
===>>> zabbix6-agent-6.0.26 >> libxml2-2.11.6 >> cmake-core-3.28.3 >> jsoncpp-1.9.5 >> meson-1.3.1_1 >> devel/py-build@py39 >> devel/py-pyproject-hooks@py39 (8/15)

===>>> Logging install to /tmp/port_log-9743-py-pyproject-hooks@py39.YaHGpHHB

===>>> Installation of py39-pyproject-hooks-1.2.0 (devel/py-pyproject-hooks@py39) failed
===>>> Aborting update

===>>> Update for devel/py-pyproject-hooks@py39 failed
===>>> Aborting update

===>>> Update for devel/py-build@py39 failed
===>>> Aborting update

===>>> Update for meson-1.3.1_1 failed
===>>> Aborting update

===>>> Update for jsoncpp-1.9.5 failed
===>>> Aborting update

===>>> Update for cmake-core-3.28.3 failed
===>>> Aborting update

===>>> Update for libxml2-2.11.6 failed
===>>> Aborting update

The installation logs contain the following details:
===> Patching for py39-pyproject-hooks-1.2.0
===> py39-pyproject-hooks-1.2.0 depends on file: /usr/local/bin/python3.9 - found
===> py39-pyproject-hooks-1.2.0 depends on package: py39-flit-core>=3.2<4 - found
===> py39-pyproject-hooks-1.2.0 depends on package: py39-installer>=0 - found
===> Configuring for py39-pyproject-hooks-1.2.0
===> Building for py39-pyproject-hooks-1.2.0
Building wheel from /usr/ports/devel/py-pyproject-hooks/work-py39/pyproject_hooks-1.2.0
Wheel built /usr/ports/devel/py-pyproject-hooks/work-py39/pyproject_hooks-1.2.0/dist/pyproject_hooks-1.2.0-py3-none-any.whl
===> Staging for py39-pyproject-hooks-1.2.0
===> Generating temporary packing list
===> Creating unique files: Move MAN files needing SUFFIX
===> Creating unique files: Move files needing SUFFIX
====> Compressing man pages (compress-man)
===> Installing for py39-pyproject-hooks-1.2.0
===> Checking if py39-pyproject-hooks is already installed
===> Registering installation for py39-pyproject-hooks-1.2.0 as automatic
Installing py39-pyproject-hooks-1.2.0...
pkg-static: py39-pyproject-hooks-1.2.0 conflicts with py39-pyproject_hooks-1.0.0_2 (installs files into the same place). Problematic file: /usr/local/lib/python3.9/site-packages/pyproject_hooks/__init__.py
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/py-pyproject-hooks
How to solve this problem?
Use pkg to devel/py-pyproject_hooks port
and then run the zabbix6-agent-6.0.26 update again?
How to solve the problem correctly?
Remove the deprecated port py-pyproject-hooks and re-run the zabbix ports update?
Code:
pkg remove py-pyproject-hooks
sudo portmaster -Hd zabbix6-agent-\*

Will this break dependent ports?

I have a lot of outdated ports and I don't know how to update them properly.
1744462005765.png
 
As the default Python version now is lang/python311 your py39-* ports appear as "orphaned". You need to upgrade Python first.

Get a list of your py39-*-ports before starting to upgrade in case you need it later.

pkg query -x %n py39 |& tee py39_ports_list

Upgrading Postgres from that very old version might get tricky. Therefore I'd lock this temporarily for a later upgrading task.
pkg lock -y -x postgres

Now you might be ready for pkg upgrade
 
Thanks for the detailed answer, POSIX.1.
This is a production mail server. Maintenance is available on weekends.
Code:
pkg query -x %n py39 |& tee py39_ports_list
py39-authres
py39-cython
py39-dnspython
py39-fail2ban
py39-flit-core
py39-installer
py39-packaging
py39-pyparsing
py39-pyproject_hooks
py39-pyspf
py39-setuptools
py39-setuptools_scm
py39-speedtest-cli
py39-sqlite3
py39-tomli
py39-wheel

I understood about the separate Postgree update. If I block it with your command, will updating python with portmaster not affect these ports?

Do I understand correctly that I need to sequentially execute the commands from the UPDATING file?
Code:
1. portmaster -o lang/python311 python39
2. REINSTALL="$(pkg info -oq '*py39*')"
3. pkg delete -f "*py39*"
4. portmaster $REINSTALL
5. REBUILD=$(pkg query -g "%n:%dn" '*' | grep py3 | grep -v py311 | cut -d : -f 1 | sort -u)
6. portmaster $REBUILD
7. REBUILD2=$(pkg list | grep python-39 | xargs pkg which | awk '{print $6}' | sort -u)
8. portmaster $REBUILD2
 
I realize now that you are using portmaster. My hints were for using ports-mgmt/pkg.
For the difference see https://docs.freebsd.org/en/books/handbook/ports/#ports-using and the warning there.

There is generally no need to build packages yourself unless there is a need to change the default port options. And if there is a need I'd advise using ports-mgmt/poudriere.

When it comes to such things as mail-servers in production, you should do all work on a separate system. Set it up, upgrade it to the latest versions, configure it, test it, move the data there, thoroughly test again, and switch finally to it within a matter of minutes.

If this is your first upgrading of PostgreSQL then be warned! You need to learn this beast before even to try. You will need several steps to get your data to the latest PostgreSQL version.
 
Read /usr/ports/UPDATING
This.

Code:
20240529:
  AFFECTS: users of python
  AUTHOR: rm@FreeBSD.org

  The default version of python3 and python was switched to 3.11.

  For ports users wanting to keep version 3.9 as default,
  add DEFAULT_VERSIONS+= python=3.9 python3=3.9 to make.conf

  Following procedures may ease the upgrade:

  For users of pre-build packages:
  # sh
  # for i in $(pkg query -g %n 'py39-*'); do pkg set -yn ${i}:py311-${i#py39-}; done
  # pkg upgrade

  For portmaster users:
  # sh
  # portmaster -o lang/python311 python39
  # REINSTALL="$(pkg info -oq '*py39*')"
  # pkg delete -f "*py39*"
  # portmaster $REINSTALL
  # REBUILD=$(pkg query -g "%n:%dn" '*' | grep py3 | grep -v py311 | cut -d : -f 1 | sort -u)
  # portmaster $REBUILD
  # REBUILD2=$(pkg list | grep python-39 | xargs pkg which | awk '{print $6}' | sort -u)
  # portmaster $REBUILD2

  Final steps (for pre-built packages & portmaster):

  If no longer required, Python 3.9 can be removed via
  "pkg remove python39" and the directory /usr/local/lib/python3.9 can
  then be deleted afterwards, if not empty.
 
Back
Top