03 March 2009 18:11 -
During the last past months I have migrated from a FreeBSD 5.2 server to a FreeBSD 7.1 server.
This also meant I had to migrate my jails to the new FreeBSD 7.1 machine. To save time compiling
the same ports over and over again I created a package building jail, which contains
all the generic packages for my jails. In this post a quick overview of the settings I made
to get this working.
In the build jail I first installed portupgrade from the ports to make it easier to upgrade ports.
After this I made the following setting in /etc/make.conf.
This indicates that all packages should be created in the /packages directory. That being the
location where I keep my packages on this host. Besides setting this in /etc/make.conf I also
have to set this in /usr/local/etc/pkgtools.conf. This can be done by making sure
the PACKAGES environment variable is set in this file. I.e.
ENV['PACKAGES'] ||= '/packages'
After this I just had to install all the base packages with make package-recursive.
Upgrading of the packages can now be done with portupgrade -vrRap to make sure
packages are being build during the upgrade process.
To allow the other jails and other machine I have exported the /packages directory on
the build host as http://buildhost/packages
Configuring the clients is now straight forward in fact. In the
/usr/local/etc/pkgtools.conf on the other jails I just had to set
the PKG_SITES variable. I.e.
PKG_SITES = [ 'http://buildhost/packages/', ]
After this upgrading of the packages on the client jails can easily be done
with portupgrade -avRrP. Or you can set the USE_PKGS_ONLY
option in the pkgtools.conf file to specify the packages that only
should be installed/upgraded from a package.