Executive and Corporate (E&C) Technical Support: The FreeBSD Ports Collection
The FreeBSD Ports Collection
The makers of FreeBSD have compiled a collection of common programs that have been designed to run on the
FreeBSD operating system. The E&C has been designed to be able to use the ports collection to install programs
on your E&C. There are several popular ports for E&C.
It is important to note that not all of the ports are compatible with the E&C environment.
The FreeBSD ports collection can be found in the /ports directory of your E&C. From there, the ports are
divided up by categories. Inside each category is a directory containing information about the individual program
for each port. The best way to see what ports are available is to check out the ports index at
http://www.freebsd.org/ports/.
Some ports may not install easily into the E&C environment, or they may require additional configuration to get
them to work. Some of the more common ports that require such special effort have a vinstall script to
ease the installation process. You may want to see if a
vinstall exists for the packages you are interested
in using.
The pkg_info command can be used for two common tasks. First, simply running pkg_info at the command
prompt will list the ports that are currently installed on your server. Another option is to find out specific information
about a port that is installed. To find out about a specific port, run pkg_info [package-name]. For more
information on the pkg_info command, see the man page.
Installing Packages
Once you have selected which package you want to add, you can use the pkg_add command. Because it is unlikely
the source files for the package are stored on your E&C, you will probably need to use the -r flag to have it
automatically retrieve the appropriate file. An example of using the pkg_add command follows.
# pkg_add -r package-name
The pkg_add command is a one-step way to install a port. Alternatively, you could go through each of the
individual steps to build the package by using the make utility. The following is an example of the commands
you would need to run to install a port using the make utility.
# cd path/to/package
# make
# make install
# make clean
Both make and pkg_add should download and install all the program files and dependencies that are
required for the package to run on your server. There may be some additional configuration steps required for
the specific program you are using.
Removing Packages
Once you have installed a package, you can use the pkg_delete or make deinstall tools to remove them.
As with any time you use make, the command must be run from the port directory where the appropriate Makefile
is stored.