2

Can someone please post a quick FreeBSD administration crash course, targeted at a Debian administrator? The environment is a production web server.

Some things I'd like to know:

  1. package management (ports or pkg_*) ? pros/cons vs. aptitude ?
  2. upgrading between releases ? e.g. aptitude safe-upgrade / full-upgrade
  3. how long is a release supported ? is there any reason not to pick the latest release ?
  4. any gotchas ?

I'm basically concerned I'm going to really miss aptitude. The ports system is cool but the majority of things I install really don't warrant the time it takes to compile from scratch. I understand you can build a package from a port to save time installing across multiple machines, but I'm just talking about one server at the moment. Is pkg* used much? It seems like everyone uses ports. Would be interested to hear how things are in practice, preferably from someone who's done both Debian and FreeBSD admin.

Background:

I've used FreeBSD and OpenBSD as my primary desktop OS at different times over the years but have spent the past 5 years running Debian on production servers.

The opportunity has arisen to move back to BSD and I'd like to give it a shot.

3 Answers3

7

The FreeBSD Handbook is your friend for all basic questions.

The ports tree and the pkg_* system are one in the same. There are also additional pkg_8 management tools in the ports tree if the built-in ones aren't enough.

Upgrading will depend heavily on your environment, but can be as easy as cd /usr/src; make buildworld; make installworld and horribly complex in the opposite environment.

The FreeBSD Security Team determines how long releases are supported (bug/security fixes). Scroll to the bottom of their page for the current schedule.

Same gotchas as most other *nix OSes; if you're familiar with Debian, you should be familiar with many already. If you have additional or more specific questions feel free to ask.

Chris S
  • 77,945
  • 11
  • 124
  • 216
  • so basically compiling from source is the only/best option? there's no binary package upgrade equivalent for buildworld? do you find this a problem in practice? i can take a debian box from sarge, to etch to lenny in next to no time. i remember running buildworld on my old bsd boxes years ago and it was the kind of thing that would run over night and then some.. although i guess that was on a 486 :) –  Sep 21 '10 at 00:11
  • You could just install the binaries from the FTP site using sysinstall, or cache them locally, or use tar to write them directly to the file system. It depends on how you want to do it. There's quite a few ways to upgrade parts of the OS or the whole thing. Upgrading from one major revision to another is usually the hardest (config file changes mostly). – Chris S Sep 21 '10 at 00:16
  • Also remember that BSD userland tools (grep, sed etc) are BSD variant, not GNU ones, so advanced usage can differ. Also, read handbook. – Kristaps Sep 21 '10 at 01:55
  • I personally find BSD's ports system to be quite elegant - it's fairly easy to manage, fairly easy to upgrade, and it doesn't have a ton of extra complexities like any other ports-like systems, like portage on Gentoo. – Christian Paredes Sep 21 '10 at 05:25
  • 4
    Don't forget binary updates using freebsd-update – hmallett Sep 21 '10 at 17:11
2

Before anything else, become familiar with the FreeBSD Handbook, in particular Part III. System Administration. It is a high quality, well-maintained manual, and usually covers everything you need to know.

1. package management (ports or pkg_*) ? pros/cons vs. aptitude ?

Handbook chapter: Packages and Ports, and you'll want to be familiar with the FreshPorts website.

The package / ports system is quite powerful, but probably lacks a front-end as nicely integrated as aptitude; you'll probably be using the individual tools more.

Rough equivalents:

  • dpkg: pkg_add, pkg_delete
  • apt-get: portmaster, portupgrade

Many people just install/upgrade from source, but FreeBSD maintains a build cluster that produces binary packages, which you can point the above tools to (pkg_add -r, portmaster/portupgrade -PP). A set of latest packages (built from ports) is maintained for each architecture and major release family (6.x, 7.x, 8.x, 9.x). Official package builds these may lag behind the corresponding port updates by a week or more (but you're probably already used to a much slower update schedule :-).

Note: one significant difference is that the ports tree itself is maintained separately from individual FreeBSD releases, and shared between them: you'll always see the same latest version of a port regardless of which FreeBSD release you're on.

2. upgrading between releases ? e.g. aptitude safe-upgrade / full-upgrade

Yes: the freebsd-update tool is used for full system upgrades (as well as applying routine security updates and bugfixes).

3. how long is a release supported ? is there any reason not to pick the latest release ?

Official support normally lasts a minimum of 12 or 24 months. See:

The oldest release still officially supported is FreeBSD 6.4 (from late 2008), and the current release, FreeBSD 8.1, is expected to be supported until middle 2012. There should be no reason not to pick the latest release; every release should be production-ready.

Pi Delport
  • 141
  • 3
1

I'm surprised that no one's mentioned Dru Lavigne's book yet. She also wrote the linux and freebsd comparison article on freebsd.org.

Those are great resources for learning the OS so that you can admin it better, but some very day-to-day stuff I'd recommend Dan Langille's FreeBSD diary.

Also, finally you should definitely check out Dru's excellent tutorial on the subject that's geared to exactly what you're looking for.

D.F.
  • 646
  • 3
  • 6