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.
 
SirDice, when i run second command
Code:
sudo REINSTALL="$(pkg info -oq '*py39*')"
i have error message: Illegal variable name.
First command has worked correctly
Code:
===>>> Done displaying pkg-message files

===>>> Upgrade of python39-3.9.22 to python311-3.11.12 complete

How can I fix my error? Or can I skip the second command and go to the third?

Sorry for my noobs questions. I run command without "sh-mode"
 
Hi, all!
I'am update python to 3.11 and now my list of ports to update is

user@mail:/ % pkg version -vL=
apache-solr-8.11.2,1 < needs updating (index has 9.8.0,1)
devcpu-data-20221109 ? orphaned: sysutils/devcpu-data
devcpu-data-intel-20221108 ? orphaned: sysutils/devcpu-data-intel
diffutils-3.8 < needs updating (index has 3.12)
dovecot-2.3.20 < needs updating (index has 2.3.21.1_3)
dovecot-pigeonhole-0.5.20 < needs updating (index has 0.5.21.1_1)
gcc11-11.3.0_7 < needs updating (index has 11.5.0)
glib-2.78.4,2 < needs updating (index has 2.84.1_2,2)
icu-72.1,1 < needs updating (index has 76.1,1)
libpthread-stubs-0.4 ? orphaned: devel/libpthread-stubs
mc-nox11-4.8.28 ? orphaned: misc/mc
openldap24-client-2.4.59_4 ? orphaned: net/openldap24-client
p5-DBD-CSV-0.59,1 < needs updating (index has 0.62,1)
postfix-3.7.3_1,1 < needs updating (index has 3.10.2,1)
postgresql12-client-12.18 ? orphaned: databases/postgresql12-client
postgresql12-server-12.13_1 ? orphaned: databases/postgresql12-server
rspamd-3.4_1 < needs updating (index has 3.11.1)
sympa-6.2.68 < needs updating (index has 6.2.76)

When i try update dovecot or postfix, it's nessesary update icu's port.
icu i try update this command: portmaster -dHr icu-\*
but it ends with the inability to update the postgresql12-server port, because it is outdated.
How to update the remaining ports correctly?
 
but it ends with the inability to update the postgresql12-server port, because it is outdated.
Now you need to upgrade Postgresql. Lookup entry 20250506 in /usr/ports/UPGRADING. But this works only for upgrading from the last version. You need to upgrade step by step from postgresql12 to what is default now. That is the penalty for not having upgraded so long. You need to carefully read (and understand)
... and note that Postgres12 became an unsupported version!
 
Thank you, POSIX.1, for not leaving me in trouble.
If I understood the information in the link correctly:
1. stop postfix, dovecot, postgresql.
2. make a dump of the current DB using pg_dumpall.
3. install a new version of postgresql (can I install 17 right away?)
4. Configure the new version to work with the dump of version 12.
That's right?

I plan not to update (replace) postgresql12-server, but to install a new version of postgresql in parallel. So that it would be possible to return to the working version if something goes wrong.

P.S. Sorry for my bad English.
 
I plan not to update (replace) postgresql12-server, but to install a new version of postgresql in parallel.
Not possible because those two version conflict. Installing one will remove the other.

Code:
CONFLICTS+=	${PORTNAME}1[^${PORTVERSION:R:C/.*([0-9]$)/\\1/}]*
This basically tells it to conflict with any other version of the port/package.

So that it would be possible to return to the working version if something goes wrong.
Postgresql databases are stored in a data directory for each version, 12 will use /var/db/postgres/data12, 17 will use /var/db/postgres/data17. Still a good idea to back up though, but unlike MySQL/MariaDB (those all use the same /var/db/mysql/) it will use separate data directories and you need to migrate the data from one to the other (using dump/restore or by using pg_upgrade(1)).
 
Thank you for reply, SirDice!
I read UPDATING file, default version postgresql is 17 now.
Is it correct to immediately update the postgresql port 12 to 17?
Or do I need to do an intermediate update 12 to 15, and 15 to 17?

My step-by-step way:
1. stop postfix, dovecot, postgresql.
2. make a dump of the current DB using pg_dumpall:
pg_dumpall > outputfile

3. update version of postgresql:
portmaster -o databases/postgresql17-server databases/postgresql12-server

4. Configure the new version postgresql to work with the dump of version 12.
That's right?
 
Hi, all!
Still «fighting» with outdated ports.
Code:
user@mail:/ % pkg version -vL=
apache-solr-8.11.2,1               <   needs updating (index has 9.8.0,1)
devcpu-data-20221109               ?   orphaned: sysutils/devcpu-data
devcpu-data-intel-20221108         ?   orphaned: sysutils/devcpu-data-intel
libpthread-stubs-0.4               ?   orphaned: devel/libpthread-stubs
mc-nox11-4.8.28                    ?   orphaned: misc/mc
readline-8.2.13_2                  >   succeeds index (index has 8.2.:[.1]}_2)
When updating rspamd, it wants to install blis and openblas as dependencies. But these are mutually exclusive ports.
1748948828424.png

1748948900310.png


Why is that? And how can I fix it?
 
Yes, your code is written in /usr/ports/math/blis/Makefile
Should I change it to --disable-cblas and try to build rspamd again?
 
Should I change it to --disable-cblas and try to build rspamd again?
No, you should turn off the CBLAS option.

Code:
===> The following configuration options are available for blis-1.1:
     CBLAS=off: build the CBLAS compatibility layer
     PARA=on: use pthread parallelization
===> Use 'make config' to modify these settings
 
Thank you, SirDice!
Installed rspamd successfully!
1748959551302.png



The readline port remains in an unknown state. After the update, it is again on the list for update.
Code:
user@mail:/ % pkg version -vL=
readline-8.2.13_2                  >   succeeds index (index has 8.2.:[.1]}_2)

If possible, please comment on how to update it?
1748959692098.png
 
update ports index by downloading the ports repositories index or build it locally:

download from repository: make -C /usr/ports fetchindex
build locally: make -C /usr/ports index

By default (if not specified by options) pkg version check versions using ports index, but fetched index may be different from locally built index, so try both. This happened to me when new 14.2-RELEASE was out but 14.1-RELEASE was not EOL. In that period, with fetched index, some ports was out-of-date. Building local index they was updated.

When I update the ports tree also update the index (fetched or built).
 
Thanks, freethread!

I built the ports tree with portsnap. Then the readline port appears.
There are no ports to update with your commands.


Code:
user@mail:~ % sudo portsnap fetch update
Looking up portsnap.FreeBSD.org mirrors... 5 mirrors found.
Fetching snapshot tag from dualstack.aws.portsnap.freebsd.org... done.
Fetching snapshot metadata... done.
Updating from Wed Jun  4 02:46:12 MSK 2025 to Wed Jun  4 08:14:01 MSK 2025.
Fetching 5 metadata patches... done.
Applying metadata patches... done.
Fetching 0 metadata files... done.
Fetching 14 patches.
(14/14) 100.00%  done.
done.
Applying patches...
done.
Fetching 0 new ports or files... done.
Removing old files and directories... done.
Extracting new files:
/usr/ports/devel/R-cran-git2r/
/usr/ports/dns/dnsmasq-devel/
/usr/ports/editors/vscode/
/usr/ports/emulators/virtualbox-ose-legacy/
/usr/ports/emulators/virtualbox-ose/
/usr/ports/graphics/mapnik/
/usr/ports/japanese/nethack34/
/usr/ports/misc/py-huggingface-hub/
/usr/ports/security/trivy/
/usr/ports/sysutils/hcloud/
/usr/ports/sysutils/py-croniter/
/usr/ports/textproc/rubygem-rails-dom-testing-rails-gitlab/
/usr/ports/www/R-cran-shinyjs/
/usr/ports/x11/grabc/
Building new INDEX files... done.
user@mail:~ % pkg version -vL=
readline-8.2.13_2                  >   succeeds index (index has 8.2.:[.1]}_2)
user@mail:~ % sudo make -C /usr/ports fetchindex
/usr/bin/env  fetch -am -o /usr/ports/INDEX-13.xz  https://download.FreeBSD.org/ports/index/INDEX-13.xz
/usr/ports/INDEX-13.xz                                1863 kB  759 kBps    03s
user@mail:~ % pkg version -vL=
user@mail:~ %


Code:
user@mail:/ % sudo make -C /usr/ports index
Generating INDEX-13 - please wait..--- describe.accessibility ---
--- describe.arabic ---
--- describe.archivers ---
--- describe.astro ---
--- describe.audio ---
--- describe.benchmarks ---
--- describe.biology ---
--- describe.cad ---
--- describe.chinese ---
--- describe.comms ---
--- describe.converters ---
--- describe.databases ---
--- describe.deskutils ---
--- describe.devel ---
--- describe.dns ---
--- describe.editors ---
--- describe.emulators ---
--- describe.finance ---
--- describe.french ---
--- describe.filesystems ---
--- describe.ftp ---
--- describe.games ---
--- describe.german ---
--- describe.graphics ---
--- describe.hebrew ---
--- describe.hungarian ---
--- describe.irc ---
--- describe.japanese ---
--- describe.java ---
--- describe.korean ---
--- describe.lang ---
--- describe.mail ---
--- describe.math ---
--- describe.misc ---
--- describe.multimedia ---
--- describe.net ---
--- describe.net-im ---
--- describe.net-mgmt ---
--- describe.net-p2p ---
--- describe.news ---
--- describe.polish ---
--- describe.ports-mgmt ---
--- describe.portuguese ---
--- describe.print ---
--- describe.russian ---
--- describe.science ---
--- describe.security ---
--- describe.shells ---
--- describe.sysutils ---
--- describe.textproc ---
--- describe.ukrainian ---
--- describe.vietnamese ---
--- describe.www ---
--- describe.x11 ---
--- describe.x11-clocks ---
--- describe.x11-drivers ---
--- describe.x11-fm ---
--- describe.x11-fonts ---
--- describe.x11-servers ---
--- describe.x11-themes ---
--- describe.x11-toolkits ---
--- describe.x11-wm ---
 Done.
user@mail:/ % pkg version -vL=
user@mail:
 
Back
Top