(This information is now available in our wiki in table format.)
The following is a short of cheat sheet I’ve put together for FreeBSD management.  All this information is available in the FreeBSD manual, but I prefer the “to the point” format of a cheat sheet.
Note that along with the individual package management commands, the sysinstall(8) utility can be used to install, delete, and list available and installed packages on a running system.
Packages page in the Freebsd manual:
The sysinstall utility can be invoked on a running system to install, delete, and list available and installed packages.

Finding a packages:


– http://www.FreeBSD.org/ports
– http://www.FreshPorts.org
In FreeBSD (both make use of the ports system to find packages, dont’t feel you have to install the port):

whereis command

# whereis lsof
lsof: /usr/ports/sysutils/lsof

make command

# cd /usr/ports
# make search name=lsof
Port:   lsof-4.56.4
Path:   /usr/ports/sysutils/lsof
Info:   Lists information about open files (similar to fstat(1))
Maint:  obrien@FreeBSD.org
Index:  sysutils
Port gives you the package/port name.
Path tell’s you where to find the package/port.
The  example, the lsof package can be found in:

Package management

Adding a packages from a local file

# pkg_add <package-file>

Adding a package from a remote server

# pkg_add -r <package-file>
Two environment variables affect where pkg_add will pull it’s packages from
when the -r option is used.
$PACKAGEROOT specifies an alternate server for pkg_add to fetch from.
Example: “ftp://ftp3.FreeBSD.org”
$PACKAGESITE specifies an alternate server with a full path for pkg_add to fetch from.
Thus it should be a complete URL to the remote package file(s).
Example: ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5-stable/Latest/

Listing packages

pkg_info <options> <file|package name>
When run with no options, lists installed packages
– pkg_version:  Compares version of installed package to the version in the ports directory.

Removing  packages

pkg_delete <package-name>
Example:  pkg_delete xchat-1.7.1