winnielinnie
MVP
- Joined
- Oct 22, 2019
- Messages
- 3,641
This applies to TrueNAS Core in general, and the FreeBSD operating system and jails more specifically.
Perhaps this is not unique to FreeBSD? (Though I've never noticed it on a Linux distro.)
Perhaps this only applies to certain binaries?
After installing the package
FreeBSD version is 13.1-REALEASE-p7:
Running straight
The same is true, of course, for
However, invoking
Naturally, this is due the the default PATH,
This leads me to believe that it will also occur with other binaries installed via "pkg", as they will be placed under
Perhaps this is not unique to FreeBSD? (Though I've never noticed it on a Linux distro.)
Perhaps this only applies to certain binaries?
After installing the package
zstd
in a jail, here are the results of the following commands.FreeBSD version is 13.1-REALEASE-p7:
Code:
freebsd-version 13.1-REALEASE-p7
Running straight
zstd
uses an older version:Code:
zstd --version *** zstd command line interface 64-bits v1.4.8, by Yann Collet ***
The same is true, of course, for
/usr/bin/zstd
:Code:
/usr/bin/zstd --version *** zstd command line interface 64-bits v1.4.8, by Yann Collet ***
However, invoking
/usr/*local*/bin/zstd
uses the newer version, installed via "pkg":Code:
/usr/local/bin/zstd --version *** Zstandard CLI (64-bit) v1.5.4, by Yann Collet ***
Naturally, this is due the the default PATH,
/usr/bin
comes before /usr/local/bin
:Code:
echo $PATH /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
This leads me to believe that it will also occur with other binaries installed via "pkg", as they will be placed under
/usr/local/bin
, meanwhile the existing binaries under /usr/bin
will take priority. (The "zstd" program is already installed and available with a newly created jail even before installing anything with "pkg".)Question 1:
Why is this the default behavior? As a user, you would expect that the binaries/libraries installed via "pkg" would take priority, since they are more recent and are constantly updated. (I want to use zstd version 1.5.4, not 1.4.8. It's newer and has performance improvements, for example. It was by accident I discovered that an older version was being used when running the command "zstd".)Question 2:
Does this also imply that "tar" will invoke the binary/libraries of the older version of zstd as well? Such as when running: Code:
tar -c -a -f archive.tar.zst sourcefile
Last edited: