The --rootdir option (was: pkg-repositories(8) and the --rootdir option of pkg(8))

From: Graham Perrin <grahamperrin_at_gmail.com>
Date: Mon, 16 Mar 2026 07:27:00 UTC
Interesting,

On 16/03/2026 02:54, Mark Millard wrote:
> …
>
> It might be that you were after --chroot instead?
>
> …


For upgrade purposes, when working with a temporarily mounted boot 
environment, I always refrained from using --chroot (because I found 
--rootdir more streamlined).

I performed hundreds of upgrades, never noticed a problem with --rootdir 
in that context.

In retrospect: maybe I never took this approach for a major upgrade, or 
a switch from RELEASE to STABLE.

Thanks, Mark.

<https://man.freebsd.org/cgi/man.cgi?query=pkg&sektion=8&manpath=freebsd-ports#OPTIONS>