Ports for newly installed system

Table of Contents

Update the ports
The ports I always install
Useful scripts

Update the ports

by ross at 07:03:08 on November 18, 2012

Update the ports tree

ports(7) explains how to work with ports.

Update the ports tree for the first time:

# portsnap fetch extract

Later on:

# 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):


#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.