I was reading through this months SysAdmin magazine, and came across Richard Bejtlich’s article “Keeping FreeBSD Up to Date.” This article was well timed, since I decided to migrate my laptop from Ubuntu Linux to FreeBSD 6.0. One hurdle in moving to any new Operating System is application and system patch management. Since I haven’t used FreeBSD since release 4.X, I needed to get up to speed on how FreeBSD handled system and application updates. Richard’s article mentions several tools that can be used to keep systems up to date, but one that caught my eye was Colin Pervical’s portsnap utility. This nifty little utility allows you to download compressed ports snapshots, and apply them to /usr/ports. Since this utility looked super cool, I decided to test it out on my new box.
To get started with portsnap, you will need to run portsnap with the “fetch” option. this will snag the latest snapshot from the SERVERNAME defined in /etc/portsnap.conf, and place the files in /var/db/portsnap:
Once a snapshot finishes downloading, the “extract” option can be used to merge the snapshot into /usr/ports:
This will extract the compressed snapshot into /usr/ports. Once the extraction process completes, the typical processes can be used to build applications (e.g., make or portsupdate). The portsnap(8) manual page mentions that the extract command should only be used to initialize a portsnap-managed ports tree, and subsequent updates should use the portsnap “update” option. If you get a chance, I highly recommend reading Richard’s article. He is a very talented writer, and provides some awesome examples!