Initial process

To download a compressed snapshot into /var/db/portsnap

# portsnap fetch
# du -sh /var/db/portsnap/
153M	/var/db/portsnap/

To extract the snapshot into /usr/ports

# portsnap extract
# du -sh /usr/ports/
860M	/usr/ports/

After the first steps shown above, /usr/ports can be updated by running

# portsnap fetch && portsnap update

Cron setting

To keep a ports tree latest, it is recommended to set cron jobs.

# crontab -e
0 3 * * * /usr/sbin/portsnap cron && /usr/sbin/portsnap update >/dev/null

portsnap cron executes portsnap fetch after random (from 1 to 3600) seconds.

pkg installation

pkg is a package control system that was introduced to FreeBSD 10.0. pkg makes binary package control very convenient. When the first time you execute pkg command, pkg will be installed automatically.

# pkg
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/freebsd:10:x86:64/latest, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.2.7... done
# pkg upgrade
Updating repository catalogue
digests.txz
packagesite.txz
Incremental update completed, 22876 packages processed:
0 packages updated, 0 removed and 22876 added.
Nothing to do