install packages with pkg_add(1) into another file system

Mark Felder feld at
Tue Oct 8 13:12:33 UTC 2013

On Tue, Oct 8, 2013, at 8:07, Matthias Apitz wrote:
> El día Tuesday, October 08, 2013 a las 07:58:06AM -0500, Mark Felder
> escribió:
> > On Tue, Oct 8, 2013, at 6:16, Matthias Apitz wrote:
> > > 
> > > So far so good. Now I want install the packages as well into the image
> > > in /mnt. What would be the best method for this? Run pkg_add with the
> > > flag --chroot chrootdir, or use chroot(8) directly? Or any other idea?
> > > 
> > > Thanks in advance
> > > 
> > > All this is with 10-CURRENT (base and ports).
> > > 
> > 
> > pkg_add and all of the old "pkgtools" do not exist in 10-CURRENT
> > anymore. Are you running a build of 10-CURRENT before they were removed?
> No. The r255948 was built on a clean, empty environment but with
> $ cat /etc/src.conf 

Ok, I won't question your needs for pkg_* as you seem to be aware of
what you're doing :-)

When you use pkg_* or pkg with their built-in chroot options it seems
that it executes those tools within those chroots instead of setting the
chroot as a destination for the installation. So if you wanted to use
--chroot I think you have to make sure the packages are available inside
the chroot. Perhaps there's some sort of DESTDIR option for the package
installation? I've been searching but have had no luck yet. I'll ask
around. It might be more reliable to do something like nullfs mount the
packages into the chroot and do the installation completely within the

More information about the freebsd-questions mailing list