Keeping FreeBSD Up To Date

2015-02-23 13:11

A comprehensive version of the Handbooks information on how to keep a FreeBSD system up to date.


Finding software

Find package using ports built-in search:

# cd /usr/ports
# make search name=<name>

Note: If message about INDEX required run make fetchindex and then try the search again.

Find package using the binary package repository:

# pkg search <name>

Add -o flag to get path in ports:

# pkg search -o <name>


Install software

By ports:

# cd /usr/ports/<path in ports>
# make install clean

By ports using portmaster:

# portmaster <path in ports>

By package (binary) using pkg:

# pkg install <name>

Keeping up to date

Update ports collection:

# cd /usr/ports
# portsnap fetch update

List software (installed from ports) that needs update:

# pkg version -l "<"

List portmaster categories and search for updates:

# portmaster -L

Update installed (from ports) software:

# portmaster -a

(If errors during upgrade process try adding -f: portmaster -af.)



Configuration for freebsd-update is found in /etc/freebsd-update.conf.

Fetch and apply security patches:

# freebsd-update fetch
# freebsd-update install

Rollback if anything goes wrong:

# freebsd-update rollback

For release upgrade see Performing Major and Minor Version Upgrades.