How I’ve been using the PC-BSD Ports Jail

So, when you install using ports, there is a lot of software you may not really want that gets installed. Are you familiar with the term build dependency.  This is software, usually a library or scripting language, that is required for a software to compile from source, but is not needed at run time.  When you always install from ports, your system will eventually have most or all the common build dependencies installed.  Really the only dependencies you need are run-time dependencies.  These dependencies make up the software that must be installed for the desired port to actually function.

Here is what I do:

  1. Install ports both in the jail and on my system pretty much at the same time with the same command, just in the different consoles.
    # portsnap fetch update
  2. Compile the port in the jail.  This will build and install everything in the jail, including the build dependencies and run time dependencies and of course the port itself.
    # cd /usr/ports/<group>/<port>
    # make install
  3. Sync the system’s ports tree with the jail’s ports tree using rsync.
    # rsync -av /usr/jails/portjail/usr/ports/ /usr/ports
  4. Install the port in the regular system.  This only installs the run time dependencies and the port itself.
    # cd /usr/ports/<group>/<port>
    # make reinstall

This seems to work, and I don’t get all the build dependencies installed. Plus the rsync command is pretty quick.

I wonder if this is how the PC-BSD team uses it too?

 

Leave a Reply

How to post code in comments?