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.

Ports

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>

Reference: http://www.freebsd.org/doc/handbook/ports-finding-applications.html

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

Reference: http://www.freebsd.org/doc/en/books/handbook/ports-using.html

System

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.

Reference: http://www.freebsd.org/doc/handbook/updating-upgrading-freebsdupdate.html