back
▲ 6 points

Ask HN: How Does the FreeBSD Ports Collection Work?

by eatonphil·11y ago·3 comments·view on hn ↗
I am a long-time Debian/Ubuntu user looking to get started on a FreeBSD system. I am a little confused by how the Ports Collection works because it seems like all supported ports are stored on the system. Doesn't this take up a massive amount of space? How does the FreeBSD Ports Collection package manager implementation compare to dpkg on Debian systems? I'd appreciate any resources or guides!
3 comments
On BSD systems, the ports collection is simply a directory tree containing some fairly small text files. The various text files in a given port (subdirectory) include Makefiles, patches, description files and checksums. When you run `make` in a port subdirectory, the target software source code is downloaded, patched, built, installed into a "fake" directory tree emulating a target system, and then finally all of the stuff it just installed is gathered up into a compressed "package" archive. In short, the ports are used to create packages.

If you're new to BSD systems, it's much easier to use the pre-built packages.

https://www.freebsd.org/ports/

https://www.freebsd.org/doc/handbook/ports-using.html

Also, it's worth pointing out that the use of the ports collection is optional in modern BSD, as you can install anything that's in ports directly as a package instead using pkg.
The ports give you the option to configure the build, where as pkg uses preset options, correct?