FreeBSD Ports: Making them Friendlier

Pages: 1 2

The FreeBSD ports collection may be a tough nut to crack if you’re used to easier package distribution systems like those found on Ubuntu or Redhat. In many ways, I find it easier to manage. The ports collection grants you greater control over what is installed, how it is configured, what dependencies you’d like to build (or rebuilt), and what upgrade path you’d like to choose whenever upgrading packages. The ports collection is so good, in fact, that several Linux distributions now borrow from the principles set forth by the FreeBSD foundation what seems like eons ago (Gentoo and its derivatives, specifically). It can be daunting to manage ports at first, but you’ll find that it offers you freedom that simply couldn’t be had from binary packages.

After all, FreeBSD is about freedom.

The FreeBSD Handbook is an excellent resource and a great place to start whenever specific activities related to managing FreeBSD need to be addressed. The handbook doesn’t cover everything (it can’t!), and it doesn’t always provide the easiest solution. It should be mentioned that the handbook has gotten much better over the years, and it now includes a comprehensive guide on many popular ways to manage your ports. It never used to, and I think the FreeBSD Documentation Project has really come a long way in the passed five years.

Another great resource is the FreeBSD Diary. It isn’t updated frequently–it doesn’t need to be–because many of the articles are still applicable to today’s FreeBSD as they were when the Diary first posted them. Generally speaking, if you’re looking for a solution that the handbook doesn’t cover, the FreeBSD Diary is a great place to search. As I mentioned earlier, the handbook has been including a number of topics it previously left as an exercise to the reader to locate elsewhere, and while it may not be necessary to search other sites, I’d still recommend giving the FreeBSD Diary a go. The Diary also has write-ups on many day-to-day activities on maintenance chores that the handbook doesn’t mention. I’ve even used the Diary for resolving esoteric problems encountered on my Gentoo boxes. Many of the Diary’s tips are universal or can be adapted for other platforms, so it’s a good idea to never underestimate the site’s utility. Information may be free, but the power it can grant you is worth more than gold.

A Brief Overview

This write-up isn’t intended to be comprehensive or complete. It’s intended to help you get your foot in the door. While past experience with other operating systems like Gentoo is helpful, it isn’t necessary. I would advise having some familiarity with Unix-like operating systems, and you certainly need to know the difference between a standard user and root. Nearly everything in this guide from this point forward can be done as root or via sudo–if you don’t know what these are, I’d suggest asking Google. I won’t cover them here.

On the other hand, if you do have experience with Unix-like operating systems such as Gentoo or Sabayon, you may find that FreeBSD’s ports collection and its management tools feel somewhat archaic. Portage was based on FreeBSD’s ports and include a number of enhancements (portage is written in Python) in what is essentially “Ports Lite,” because it doesn’t require a great deal of exposure to anything beyond the capabilities of emerge.

The important thing to remember about ports is that all of the software available to you is categorized. If you’re familiar with Gentoo, you’ll notice that ports contains fewer categories than portage. This doesn’t mean there’s less software, it just means that the software is categorized differently. Further, each individual port is represented by a handful of files that indicate where to obtain it, what it is, and other useful data related to the port’s dependencies and requirements.

The ports collection is also useful if you simply don’t want extra cruft on your system. If you’ve ever tried to install a single package on Ubuntu, you’ve probably noticed that it’ll fetch a number of other packages that your original selection depends upon. FreeBSD does the same thing; however, if you’re installing software from ports and you happen to be installing a package that allows you to configure what external libraries it needs, you may discover that ports won’t obtain anything extra. In short, ports only attacks the specific problem you ask it to (within the constraints of the package you’re installing, of course).

Also note that the ports collection isn’t the only package management that FreeBSD provides. Ports is simply my preferred method for installing new software on FreeBSD. If you’d rather install binary packages, nearly everything obtainable via ports is available pre-built from various FreeBSD mirror sites. Simply run sysinstall and have a look around at the FTP/HTTP options for installing new packages. This article won’t discuss pre-built packages for FreeBSD. If you want to go that route, please look at the handbook!

Pages: 1 2

***

Leave a comment

Valid tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>