These pages present some useful information about Linux and our systems:

  1. An introduction to Linux and Gentoo
  2. Interacting with hardware on our systems
  3. Some useful packages you might not know about
  4. Some useful configuration info
  5. Running Windows applications in Linux
  6. Making Bootable CDs for Giving Talks
  7. Thoughts on the PostScript run operator
  8. Getting good performance out of a backup system

The Micromechanics Group's Linux® Network: Introduction

Our lab has a network of computers configured to run the GNU/Linux operating system. These pages are intended to provide information about what Linux is, how our particular network is set up, and how to do some basic and advanced things in Linux.

What is Linux?

Linux is a Free operating system (OS) kernel. An OS is a piece of software that controls the hardware at a low level, and allows other programs to run. UNIX©, Mac OS X©, and DOS© are all examples of OSes. Recent versions of Microsoft Windows© also include an OS, but are many other things besides. In the first sentence, the word free means "free as in beer," but it also means "Free (with a capital F) as in freedom." That is, the full source code for the Linux kernel is freely available for anyone to download, read, and modify. The only restriction is that if you modify the kernel and then give your modified version to someone else, you also have to give them the source code for your changes. This is often considered to be an unreasonable restriction, but it is no more unreasonable than not allowing access to the code in the first place. In addition, having access to the source code allows you (or others) to fix problems that may arise when using the software. This is analagous to being able to open the hood of your car - you may not tinker with the parts yourself, but you'd certainly like your local mechanic to have access!

When you start up the computer, the first thing that happens (simplifying things a bit) is that the OS gets loaded. However, an OS by itself is not very useful in most cases. In order to interact with the computer, you need to run programs. Many of the programs that run under the Linux OS were developed as part of the GNU project, and most of the rest were created using compilers and libraries written by GNU. Hence the combination of the OS and programs is often referred to as GNU/Linux. Surprisingly, the vast majority of these applications are Free, having been donated to the Linux community through the efforts of software developers worldwide, working either independently or on behalf of a company. In addition, many software packages (MATLAB, Opera, and RealPlayer, for example) are closed-source (meaning you don't have access to the source code), and often cost money, just like most software for Windows. This is a Good ThingTM, since it allows us to run commercial software that would otherwise never get released for Linux.

What is a Linux Distribution?

With the wide range of Linux software that is freely available, it can be a challenging task to collect all the software you need and install it on a computer, much less keep up to date. To make those tasks easier, many organizations have developed Linux distributions: a combination of the Linux kernel, various software programs, and "glue" to hold it all together. Since the kernel and programs are nearly the same from one distribution to the next, the differences are primarily in the glue layer. There are more than a hundred Linux distributions available. One of the most popular is RedHatTM, which is what we used in the lab for several years. More recently, a group called Gentoo has released their own distribution, which is more powerful in many ways. Our new computers, some of our experiment machines, and our web/mail server all run Gentoo now.

What is Gentoo Linux

The Gentoo Linux distribution is unique in many ways. Some of the advantages of Gentoo are

  1. Gentoo builds programs from the source code, so if a program builds properly, you know that your system has all of the libraries needed to run it.
  2. Gentoo lets you set the compile flags (in /etc/make.conf), so you can optimize the entire system to your particular architecture. This process has been reported to give up to a 15% increase in the speed of the system as compared to other distributions.
  3. Many programs have optional dependencies; for example, xpdf can be built with the TrueType font library if it's available, but can also be built without it. Gentoo lets you customize which optional settings you would like to use by changing the USE variable in /etc/make.conf.
  4. Gentoo resolves dependencies automatically; if you want to install Quanta, but you don't have MySQL installed, Gentoo will download and install MySQL first.
  5. Gentoo keeps you up to date. In some distributions (*cough* RedHat *cough*), if you're running an older version of the distribution and you want to install a newer program, you're pretty much out of luck unless you rebuild your system from scratch. In Gentoo, if you want the latest version of XFree86 for example, you would just type emerge -u xfree86, and once it's done building, you'll have the latest version.
  6. Gentoo doesn't clobber your config files when you install a new version of a program. Instead, it has a program, etc-update, that lets you keep or replace each config file, or interactively merge differences between the two.

Gentoo's power comes largely from its package management system, Portage. Portage is a ports-based system, meaning that it manages the process of downloading, compiling, and installing the source code for the packages you want. Our network is set up so that the compile step uses a program called distcc, which splits the compile job among all of our new machines, speeding the process up considerably. You can use distcc when compiling your own programs, too - just put CC=distcc near the top of your Makefile, and make sure to set the DISTCC_HOSTS environment variable in your shell (the easiest way to do this is to type source /etc/profile). There are two primary programs that you should use to interact with Portage:

The program that installs software. For example, typing emerge joe would download, compile, and install the joe editor, along with any programs or libraries that it depends on. By default, it will do this even if joe is already installed. To change this behavior, use the -u option. emerge -u joe will only recompile joe if a new version is available, or if one of the libraries it depends on has been updated. One other option, -p, gets emerge to tell you what it would do without actually doing it. I recommend always running emerge with -p before actually running it, to make sure you're not setting yourself up for a long compile job. Finally, you can run emerge rsync to update the current list of packages.
The program that lets you query packages. Qpkg has a bunch of options, depending on what kind of information you want:
gives you a brief description of the package.
lists the contents of an installed package.
gives you a list of packages that the current package depends on.
-f filename
finds the package that the specified file belongs to.
performs the query on only installed packages.
gets rid of the color scheme that's unreadable with a white background.
Note that the current list of packages is stored in subdirectories of /usr/portage. For example, /usr/portage/media-gfx/gimp contains ebuilds (which are package-building instructions) for the gimp package.