in Code Snippets, Hacking

FreeBSD Update all php packages to a new version

When PHP is installed on a FreeBSD system, you have a lot of packages, for example:

pkg prime-list
php80-ctype
php80-curl
php80-exif
...
php80-tokenizer
php80-zip
php80-zlib

To update all these packages to newer version the following can be used :-)

# first note what was installed (optional but recommended)
pkg prime-list > /tmp/installed-packeges.txt

# then execute the update command php80 => php83
cat /tmp/installed-packages.txt | grep php80 | sed 's/php80/php83/g' | xargs -o  pkg install