Building ports with sorces on a local mirror?

Jonathan McKeown jonathan at
Mon Aug 28 07:55:43 UTC 2006

On Saturday 26 August 2006 22:15, stan wrote:
> I'm in the process of seting up to build a fair number of machines behind a
> very restrictive firewall (and besides that the outbound link is very
> slow).
> What I have in mind is setting up a machine using mirror software to create
> a local mirror of the FreeBSD site, including the distfiles for the ports
> tree.
> Is thee a way to get the ports build system to look for distfiles on this
> local mirror?

I'm doing something similar, but I'm keeping the ports tree on one machine and 
NFS-mounting /usr/ports from there on all my other hosts. Each host other 
than the master has


in /etc/make.conf.

Each time I build a port on any of the machines, it downloads the distfile if 
it doesn't already exist - but because /usr/ports is on the master server, 
that's where all the distfiles end up (in /usr/ports/distfiles), so I 
download each source tarball once, the first time it needs to be installed. 
This saves bandwidth as I'm not trying to mirror all the distfiles whether I 
need them or not.

You can also make packages which will be stored on the master server so you 
don't even have to compile more than once unless you need to. Word of 
warning: take steps to avoid downloading prebuilt packages if you don't have 
a locally-built package. For example, with portupgrade, edit
/usr/local/etc/pkgtools.conf and add


which prevents ever fetching a package from the Internet: if there isn't a 
local package it will build from source in the ports tree.


More information about the freebsd-questions mailing list