Specify path for pkg install?

Hi All,

I am running version 9.3 and I am wanting to install git.

The following command works:

pkg install git

But I would like to specify where to install git and not the default, is that possible?

Thanks, Chris.
 
Only if it's a chroot(8) environment.

From pkg(1):
Code:
-c    <chroot    path>
         pkg will chroot in    the <chroot path> Environment

Thanks for your help. I tried this but got the following error:
Code:
pkg: open(/bin/sh): No such file or directory
pkg: open(/bin/sh): No such file or directory
pkg: Unable to determine ABI
pkg: Cannot parse configuration file!
Any suggestions?
 
You never mentioned why you need to do this?

Instead of installing in a chroot you can specify a different root directory with pkg -r /path/to/dir install git.

However this might not do what you want. As far as I know the paths where Git looks for its support files are hard coded at compile time (probably overridable via environment variables but that's more trouble than it's worth IMHO).

It's probably easier to compile Git from source and passing a different prefix there (look at the INSTALL in the Git source code for instructions).
 
You never mentioned why you need to do this?

Instead of installing in a chroot you can specify a different root directory with pkg -r /path/to/dir install git.

However this might not do what you want. As far as I know the paths where Git looks for its support files are hard coded at compile time (probably overridable via environment variables but that's more trouble than it's worth IMHO).

It's probably easier to compile Git from source and passing a different prefix there (look at the INSTALL in the Git source code for instructions).

Sorry, I am building a NAS using FreeBSD + zfs but I have installed it embedded. The problem is, when I install git without specifying a path, it gets wiped after a reboot which is understandable. I am trying to specify it to install git into a directory in my pool, so that it persists. I know that jails or a full installation would overcome this but that is not what the person wants who I am building it for.

Trying your command was a bit better but failed when trying to create /mnt/pool/pkg/git/usr/local/bin/perl5.
 
Back
Top