pkg-add for installing into a jail?

Matthew Seaman m.seaman at
Mon Aug 1 09:57:10 UTC 2016

On 07/31/16 10:38, Alnis Morics wrote:
> test:/usr/ports/packages/All# pkg -j 1 add apache22-2.2.31_1.txz
> apr-
> pkg: apache22-2.2.31_1.txz: No such file or directory
> pkg: Was 'pkg install apache22-2.2.31_1.txz' meant?
> pkg: apr- No such file or directory
> pkg: Was 'pkg install apr-' meant?
> Failed to install the following 2 package(s): apache22-2.2.31_1.txz,
> apr-
> If there is "No such file or directory", where does pkg look for them?
> (I also tried to use full path; the result is the same) Or is pkg-add an
> exception which doesn't work with -j option?

pkg -j 1 something

works by jexec'ing itself in the indicated jail first of all, and only
then parsing the rest of the command line including opening any files
listed there.  Unless you have the apache22-2.2.31_1.txz package already
available in the right location *inside* the jail you're going to get
'file not found'.

It's the same deal with 'pkg -d /somewhere' except that uses chroot(2)
rather than jail(2).



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the freebsd-questions mailing list