posted by Nathan Mace on Thu 31st Jan 2002 18:45 UTC
IconBy now, anyone who is even remotely related to an IT-type position has heard about Linux, and has most likely used it, if only to see what all the hype is about. However, GNU/Linux is not the only "free" Unix type OS available. FreeBSD and its cousins, NetBSD and OpenBSD are all offshoots of BSD UNIX, a commercial UNIX also known as Berkeley Software Distribution. This article will help you learn more about FreeBSD, its differences from Linux, and it will ease a potential migration process.

Unlike Linux which uses the GPL license, the BSD family uses the BSD-style license. To summarize the differences between the two licenses in one sentence, the GPL requires any changes to the source code to be made public and be licensed under the GPL as well. The BSD license has no such requirement, any changes can be kept proprietary.

There are several major differences in the way FreeBSD and the major Linux distributions work. This article will step you through what I consider to be the biggest 'gotchas' that I encountered when switching my desktop from Linux to FreeBSD.

Although there are people who will argue this point, the term Linux refers to the kernel, nothing more. The applications that you use everyday on your Red Hat or Debian box are utilities added on by the respective distributions. FreeBSD on the other hand refers to the OS as a whole. FreeBSD is itself the kernel, as well as the basic applications needed to use a computer, such as the copy and move commands. This difference results in there being several distributions of Linux, such as Mandrake, SuSE, Debian and Slackware. Anyone who has used both Mandrake and Debian can tell you that there is a world of difference between them. There is only one FreeBSD. My FreeBSD is the same as the FreeBSD that you have -- except for differences between versions FreeBSD is FreeBSD.

Three of the biggest Linux distributions, Red Hat, Mandrake, and SuSE use the RPM package manager. RPM handles installing, upgrading, uninstalling, and dependency checking for programs installed on those OSes. Although it does check for dependency errors before installing a program, RPM does leave a lot to be desired. For example, it cannot fetch other RPMs that are needed to solve the dependency errors. I know of are least 3 projects that solve this, urpmi, Debian's apt-get which by the way isn't remotely related to RPM and is a 'Debian only' feature, and a hybrid between RPM and apt-get. So unless you are willing to use one of the methods stated above, you have to manually find and download the required RPMs. Sound easy? Well it does until you try to manually install gnome or upgrade XFree from RPM's. Even after you find the correct RPMs, if they are for SuSE and you're running Red Hat, chances are they still might not work.

Each distribution of Linux is slightly different, and where they differ the most is in the file system layout. I'm sure that most everyone has heard about SuSE putting KDE in /opt while Red Hat puts in the /usr folder. To make matters even worse, RPM doesn't recognize programs that are compiled from source. So if you have the latest and greatest Qt compiled from source, RPM doesn't even know it exists if you try to install KDE from rpm's.

FreeBSD uses what are known as "packages" to install, uninstall and upgrade applications. The 'pkg_add' command is used to install a package that you have manually downloaded to your computer. You can also run it with the '-r' flag followed by a package name, and it will remotely fetch it from the Internet, as well as anything it requires to run. But the real beauty of FreeBSD's packages is in the ports tree. The ports tree is simply that -- a hierarchy of applications that have been ported to FreeBSD. Each directory contains a Makefile and any patches that are required for that particular app to compile and run on FreeBSD. For example, if I want to install the Apache web server, all I have to do is cd into the /usr/ports/www/apache directory, type 'make && make install', and go visit the snack machine. Assuming I have a fast computer with a decent Internet connection, when I get back it will have downloaded the apache source code, patched it, compiled it and installed it for me! The ports tree also handles any dependencies that Apache needs to run. It doesn't matter if I've installed something via the ports tree, compiled it manually, on installed it via a binary package. The ports tree can find it as long as it is in your $PATH, and act accordingly.

Another difference between Linux and FreeBSD, is that with FreeBSD, 99% of what you install via ports or packages defaults into /usr/local, where as in Linux most of it goes into /usr, and sometimes /opt. This is for the most part a minor difference, however it is nice to know that whatever you have installed is in /usr/local and not spread all over the filesystem.

Table of contents
  1. "Migration Guide Part I"
  2. "Migration Guide Part II"
e p (0)    58 Comment(s)

Technology White Papers

See More