zstd package is version different than binary version

Started by therobin, May 27, 2025, 06:37:50 PM

Previous topic - Next topic
I am running opnsense baremetal on my N100 firewall/router. Running latest version:
OPNsense 25.1.7_4-amd64
FreeBSD 14.2-RELEASE-p3
OpenSSL 3.0.16

I was testing zstd in the shell and noticed unusual numbers when benchmarking along with it using the wrong generator. It was using synthetic generator which was replaced by lorem ipsum in 1.5.6. When I check the package version from opnsense, it tells me it is the latest version: 1.5.7. But when I check zstd version directly from the binary, it tell me it is very outdated 1.5.2.

root@OPN100:~ # pkg info --all | grep zstd
zstd-1.5.7                     Fast real-time compression algorithm
root@OPN100:~ # zstd -v
*** zstd command line interface 64-bits v1.5.2, by Yann Collet ***

This is the difference between the base system (FreeBSD) installed version and the one installed from Ports (pkg).

root@scrambler:~ # /usr/bin/which -a zstd
/usr/bin/zstd
/usr/local/bin/zstd
root@scrambler:~ #

Everything installed from the base FreeBSD system is in /bin /usr/bin and such, and all from Ports is in /usr/local/.

The path shows in which order things are used:
root@scrambler:~ # echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
root@scrambler:~ #

So to use the Ports zstd you have to use /usr/local/bin/zstd
root@scrambler:~ # /usr/local/bin/zstd -v
*** Zstandard CLI (64-bit) v1.5.7, by Yann Collet ***
stdin is a console, aborting
root@scrambler:~ #

Thanks for that information.

Which one represents what would get used if I set the filesystem to zstd compression? I am assuming the first in the path atm.

None of them. It's compiled into the ZFS code in the kernel.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)