You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running pkg with the --rootdir option, it loads repo configuration from outside the root and then attempts to load fingerprints from inside the root.
zfs create zroot/usr/jail/example
tar xJf base.txz -C /usr/jail/example
Install a package
pkg -r /usr/jail/example install zsh
Expected behavior
The package is installed under the root from the custom repo defined outside the root.
Observed behavior
Updating example repository catalogue...
Fetching meta.conf: 100% 178 B 0.2kB/s 00:01
Fetching data.pkg: 100% 31 MiB 1.3MB/s 00:25
pkg: Error opening the trusted directory /usr/local/etc/pkg/keys/trusted
pkg: Error loading trusted certificates
example repository is up to date.
All repositories are up to date.
pkg: Repository example cannot be opened. 'pkg update' required
pkg: No packages available to install matching 'zsh' have been found in the repositories
The text was updated successfully, but these errors were encountered:
the handling of fingerprints in pkg with rootdir is the same as with other package managers, e.g. apk.
The general idea is that once you are in the rootdir, pkg running outside should behave the same as pkg would do running inside.
So in fact, the inconsistency is the other way round. When given a rootdir, the configuration files from outside should not in fact be consulted at all.
You will observe that once you set a configuration file inside the rootdir, that becomes effective and any repository defined only outside becomes unavailable. Very counterintuitive.
It is even more confusing once you install pkg on a completely different prefix, e.g. /opt/pkg/. Then the compile time prefix is used as the default also inside the rootdir, where it most likely does not make sense at all.
So if the outside pkg was compiled with /opt/pkg prefix, it will try to look for rootdir/opt/pkg/etc/pkg for its configuration, whereas most likely the rootdir uses a stock pkg prefix of /usr/local and expects configuration in rootdir/usr/local/etc/pkg.
I guess the current choices are made both on evolutionary as well as convenience basis.
Only compiling the list of expected behaviour is a task on its own.
Summary
When running pkg with the
--rootdir
option, it loads repo configuration from outside the root and then attempts to load fingerprints from inside the root.Details
How to reproduce
/usr/local/etc/pkg/repos/example.conf
/usr/local/etc/pkg/keys/trusted/example
Expected behavior
The package is installed under the root from the custom repo defined outside the root.
Observed behavior
The text was updated successfully, but these errors were encountered: