Skip to content

Instantly share code, notes, and snippets.

@daemonhorn
Last active September 9, 2023 19:01
Show Gist options
  • Save daemonhorn/c0737e01f16e53b23f4c68e425745b0e to your computer and use it in GitHub Desktop.
Save daemonhorn/c0737e01f16e53b23f4c68e425745b0e to your computer and use it in GitHub Desktop.
FreeBSD Ports Cheat Sheet and Notes

FreeBSD Ports

Some random FreeBSD Ports information for future me

Configuration file: /etc/make.conf

  • Add BATCH=YES to prevent questions and dialog4ports(1) from slowing you down.

Ports make targets from man ports(7)

  • config to force a configuration display/choice (even if BATCH=YES has been defined)
  • fetch and fetch-recursive to download the source packages if not cached
  • install and reinstall to install and force-reinstall the port and register with package database
  • deinstall to uninstall/remove the port and de-register from package database
  • build-depends-list, run-depends-list, all-depends-list to just list the names of the dependancies
  • clean and distclean Remove (source code or distfiles) of port and dependancies
  • search to search the INDEX file for a key or name value (e.g. make search key=fido)
  • depends to make all of the dependancies. This can be very slow if you end up having to compile things like compilers or build tools on top of other ports.

Shell Snippets

Speed up building a single port from /usr/ports

By default, freebsd ports has make depends and make build-depends-list, but nothing to install the build dependancies from binary pkg packages. I use this to avoid having to build a large dependancy list of packages all from source when I only want to build a single package from source.

bld_dep_list="$(make build-depends-list | sed s/\\\/usr\\\/ports\\\///g)"
pkg install ${bld_dep_list}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment