Update the ports
Update the ports tree
ports(7) explains how to work with ports.
Update the ports tree for the first time:
# portsnap fetch extract
# portsnap fetch update
Update installed ports
Novices to FreeBSD usually make one big mistake. They simply run portupgrade -a or portmaster -a to update without consulting first with /usr/ports/UPDATING.
This file contains instructions on how to deal with dependencies when a major version of a library changes and information on splitted/renamed ports.
I wrote a simple script that lists outdated ports of the host and every ezjail and also prints today's and yesterday's entries from /usr/ports/UPDATING.
The script requires ports-mgmt/portupgrade in the host and in each jail.
# mkdir /root/bin # cd /root/bin # fetch http://daemon-notes.com/downloads/assets/scripts/update-ports # chmod u+x update-ports
Edit root's crontab (run crontab -e as root):
SHELL=/bin/sh PATH=/root/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin HOME=/root #minute hour mday month wday command 0 3 * * * update-ports cron
Root will receive an email with list of outdated ports and last instructions of /usr/ports/UPDATING (sometimes not applicable to your ports but it's better than nothing). You can also run the script by hand, not via cron, in which case run it without arguments.