Monday, 2011-01-03

Keeping a FreeBSD system up to date

I like using FreeBSD compared to Linux (or “lulnix” as we cool kids say nowadays) but distros like RedHat and Ubuntu have the edge when it comes to making it easy to keep your system up to date with the latest patches.

You’d think there was a simple one-shot way of doing this, but so far I’ve settled for the following method. It’s documented here as much for my own memory as anything else.

  1. refresh your ports tree with cvsup: cvsup -g -L 2 /usr/local/etc/ports-supfile (you should edit the ports-supfile to reflect your geographical location).
  2. run the portupgrade command: portupgrade -a -PP -Rr -i.

The options I use for portupgrade are:

  • -a: all ports
  • -PP: use only packages (use a single P if you want to compile a port where a package isn’t available)
  • -Rr: both recursive and upwardly recursive
  • -i, for interactive. I run this because once when I ran without it my perl got upgraded to a new point release under me and broke my CPAN modules. YMMV.