FreeBSD Packages

Ports and Packages

A few notes regarding ports (source installs) and packages (binary installs):

  • The versions may be different from each other (PHP 5.3.15 in ports, PHP 5.3.14 in packages)
  • You can mix and match between the two (one source install, one binary), but it is not recommended
  • FreeBSD by default will install packages that were built for the original release
  • You must set PACKAGESITE environment variable yourself to get latest packages
Setup package repo


echo setenv PACKAGESITE >> ~/.cshrc
source ~/.cshrc


echo PACKAGESITE= >> ~/.bashrc
source ~/.bashrc

Install Base Packages

Now you're ready to install system packages. The first thing to do is install bsdadminscripts which will make managing packages much simpler.

cd /usr/ports/sysutils/bsdadminscripts
make clean install

The bsdadminsciripts package gets the package information directly from an FTP server, instead of relying on the data in ports. It also comes with a script pkg_upgrade which makes installation and upgrading much simpler.

Install some basics to get started:

pkg_upgrade -r `fetch -q -o -`
chsh -s /usr/local/bin/bash

Install Fixes

Upgrade FreeBSD to use devel/pkgconf instead of devel/pkg-config:

pkg_upgrade -r portmaster
portmaster -o devel/pkgconf devel/pkg-config


List installed packages:


Download package list for parsing:

curl -s | cut -d "/" -f 2


Install a package using the shortname, fex wget. This will pull in all dependencies as well.

pkg_add -r wget