Install a package

pkg_add -r <package_name>

Deinstall a package

pkg_deinstall <package_name>

Useful options

-n don't deinstall, just reports the steps that would be taken
-r remove also the packages depending on the given package

Reconfigure a package

  1. Go to the ports directory
  2. make clean
  3. make config if it has a config package associated with it
  4. make
  5. either make install or make deinstall && make reinstall

Update a ports tree using portscan

  1. Install sysutils/portsnap package from ports tree
  2. Fetch a snapshot:
    portsnap fetch
  3. If this is the first time portsnap is used:
    portsnap extract.
    Otherwise, if you're just updating an existing portsnap tree:
    portsnap update