(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:
In FreeBSD (both make use of the ports system to find packages, dont’t feel you have to install the port):
# whereis lsof
# cd /usr/ports
# make search name=lsof
Info: Lists information about open files (similar to fstat(1))
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:
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.
$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).
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.
Example: pkg_delete xchat-1.7.1