Navigation:

Search



Related Articles

Our Friends

Articles Installing and Using Debian
 

Installing and Using Debian

This was written by David Shea and given on Sun Jun 16 2002.

Table of Contents


1. What is Debian?

Debian is a distribution of the GNU/Linux operating system that is developed and maintained entirely by volunteers. The Debian Project is committed to freedom, as defined by their social contract ( http://www.debian.org/social_contract ). All software in Debian, as well as all aspects of the distribution itself, may be modified and redistributed, in source or binary form, free of charge.

Software that does not meet the Debian Free Software Guidelines (DFSG) but has been configured for use in a Debian system is also available, though it is not a part of the Debian Project, and redistribution of these packages may be restricted. The non-free section of the package archives contains software that does not meet the requirements of the DFSG, and the contrib section contains packages that are themselves free, but depend on software that is not.

Though freedom is the raison d'e^tre of the Debian project, it is not the only reason that people find to use this distribution. The packaging system has been built in such a way that the entire system may be upgraded with a minimal amount of effort and while the system is still running. The large amount of packages available allows for a wide variety of software to be installed without worrying about how it will fit with the rest of the system. The "unstable" branch of the distribution is updated continuously, which allows users to keep up with the latest in software development while retaining the advantages of a packaging system. On the other end of the spectrum, the "stable" branch is extensively tested before release, making it very stable and secure.

1.1. A quick note on versions

Currently, three branches of the Debian distribution are maintained at a time: stable, testing, and unstable. Stable is the most recent official release, and contains packages that have been thoroughly tested and meet the requirements for stability and security. The only changes made to the stable branch are to repair security holes and other critical bugs found after the release. Stable is often accused of being out of date, since the release schedule tends to be a bit slow. At the time of this writing, the current stable branch of Debian is 22 months old.

Unstable contains the most recent available version of every package, bugs and all.

The testing branch was created after the release of potato as an attempt to create a compromise between stable and unstable. Packages are automatically placed in testing from unstable based on activity in the bug reports ( http://bugs.debian.org/ ). Once the release manager decides that it's ready, testing will be renamed to frozen, and the testing cycles will begin in preparation for a release.

All versions of Debian since 1.1 (buzz) have been named after characters from the movie Toy Story, and these are usually the names by which the versions are referred. The current active versions are potato (2.2, stable), woody (3.0, testing), and sid (unstable).

2. Installing Debian
2.1. How to get debian
2.1.1. cdrom

As with most other Linux distributions, bootable ISO CD images of the installation files are available for download. At one time there was a frightening labyrinth of questions that had to be answered correctly before finally being shown the list of mirrors, in an attempt to lighten the load on them. Fortunately, this is no more, and the CD page ( http://www.debian.org/CD/ ) now tells you where to find the CD images, rather than telling you to buy a CD or perform some arcane ritual involving the package mirrors and rsync. However, a full install CD may not be necessary. Unless you are unable to get your network working during the install, it may be better to download only enough to boot your system and install the rest over the network.

2.1.2. floppies

There are floppy images available for potato and woody which contain enough to boot the system, install the kernel and drivers, and install the rest of the base system through some other means. The base system is contained in a tarball located in the same directory as the disk images, and may be automatically downloaded over http or ftp by the installer, downloaded manually and made available on a local partition or over nfs, installed from a Debian CD, or installed from another stack of floppies.

All floppy images are available in /debian/dists/(potato|woody)/main/disks-> arch> in a package mirror, where> arch> is the architecture of the machine on which you wish to install Debian.

2.1.3. minimal cdrom

For those who loathe making floppies but don't want or need a full CD, there is hope. Small CD images containing only the contents of the rescue, root, and driver floppy images are available from http://www.debian.org/CD/netinst/ and work well for a network installation of Debian.

2.2. The install

Though many people curse and say nasty things about the installation process, it's actually not too bad. It has gone through several improvements in usability and stability in the recent past, and most people will be able to simply walk through the steps in the installation menu without difficulty. If a shell is needed for any reason, one can be found on tty2 (accessible with alt-F2), or by scrolling down the installation menu to "Execute a shell", which will run a shell on that console and return to the install menu when the shell exits.

Once the base packages have been installed and a means of booting the system has been created, you may reboot the system into Debian, at which point some basic configuration will be handled (root password, timezone, non-root account), and further package installation will commence.

3. The Debian Package System

Debian packages are similar to Redhat's RPMs, with the greatest difference being a more finely tuned system of dependencies. In addition to dependencies and conflicts, deb packages have recommended and suggested packages, which, though not absolutely necessary to install or run the software in the given package, may be helpful.

The thing that makes Debian packages great, however, is the Advanced Package Tool, apt. apt is a package management system that handles downloading, installing, and configuring packages and their dependencies. Most of the package management tools are actually frontends to apt.

The only thing that you should need to worry about within apt itself is the /etc/apt/sources.list file, which tells apt where to find new packages. The sources.list file is a list of locations of package archives, in order of preference. The newest available version of a package will always be used, and if more than one location has the newest version, the package will be downloaded from the one that occurs earliest in sources.list.

Each line consists of the type (deb for binary packages, deb-src for source packages), the location, the version to use (referenced either by codename (potato, woody, etc) or status (stable, frozen, etc)), and a list of the branches to use. The current branches are main, contrib, and non-free, as well as non-US versions of each. Here is an example sources.list:

# Local package mirror, generated by apt-move
deb file:/var/mirror/debian potato main

deb ftp://ftp-linux.cc.gatech.edu/debian potato main contrib non-free
deb http://www.debian.org/debian potato main contrib non-free

# Packages that can't be exported from the US, usually due to encryption or patents
deb ftp://nonus.debian.org/debian-non-US potato/non-US main contrib non-free

# Source packages for above, so apt-get source> pkg-name <  will work
deb-src ftp://ftp-linux.cc.gatech.edu/debian potato main contrib non-free
deb-src ftp://ftp.debian.org/debian potato main contrib non-free
deb-src ftp://nonus.debian.org/debian-non-US potato/non-US main contrib non-free

# If a security hole is found in the stable distribution, the fixed version
# of the package will be put here
deb http://security.debian.org/ stable/updates main contrib non-free

3.1. Command line utilities
3.1.1. apt-get

apt-get is the command line interface to apt. With a few simple commands, it can be used to update the list of available packages, install and remove individual packages and their dependencies, and upgrade all the packages in the system to the latest available version. However, apt-get may not be best for installing packages, since it ignores the Recommends and Suggests fields, which may create difficulty in the expected functionality of a package. Suggestions that apt-get have features added to report recommended and suggested packages are generally met with claims that apt-get isn't meant to be used that way, use some other frontend. Regardless, apt-get is still useful for many tasks, and it is helpful to at least be familiar with some of the commands.

update
running 'apt-get update' will download the latest package lists from the locations you put in sources.list, updating the local list of available packages. It is generally a good idea to run this before doing anything else.
install> package name...>
Installs the packages and any dependencies
remove> package name...>
Removes the packages and any packages that depend on them. Configuration files, if present, will be left behind, so the packages will be left in the 'deinstall' state until purged.
upgrade
Upgrades all packages in the system to the latest version
dist-upgrade
Same as upgrade, but attempts determine changed dependency names and may be used for upgrading across versions. For example, if you are running potato and want to run sid instead, you can simply change all instances of potato in /etc/sources.list to sid and run 'apt-get update; apt-get dist-upgrade' which will upgrade your system with a minimal amount of trouble.
3.1.2. apt-cache

The full functionality of apt-cache isn't terribly useful unless you really enjoy playing around with apt's package cache, but it can be useful for finding a particular package name. 'apt-cache search> regex>' will give a list of all packages with a name that matches the regular expression, along with a single-line description. 'apt-cache depends> pkg name...>' will print out all Dependencies, Recommendations, and Suggestions for the packages.

3.1.3. apt-move

apt-move is very useful if you run Debian on more than one computer. It can be used to generate a package archive, usable by other machines, from the package files downloaded by APT.

3.2. The frontends
3.2.1. tasksel

tasksel is what is run when you choose the "Simple" package selection method during the initial configuration. There are meta packages available, named task-*, which contain no data and depend on groups of other packages. tasksel simply chooses and installs these task-* packages. However, tasksel cannot be used to uninstall anything, and can only be used to install whatever the Debian maintainers felt would make an appropriate group of packages, so it's not very useful outside of the initial configuration.

3.2.2. dselect

dselect, the "Advanced" side of the initial package selection, is the tool that is generally suggested for an everyday package management tool. It can be used to install, remove, purge, and hold back (package won't be upgraded even if newer version is available) individual packages and dependencies. It notifies the user of recommended and suggested packages and offers menus to handle situations where more than one package meets a particular dependency, or to resolve dependency conflicts. However, it's extremely slow, has a very user unfriendly interface, and is impossible to navigate. dselect is single-handedly responsible for turning countless users away from Debian.

3.2.3. aptitude

aptitude, like dselect, has a curses interface, but, unlike dselect, it can search through the package database at a reasonable speed, and its interface is much easier to use. aptitude also allows operations to be performed on the command line, much like apt-get.

3.2.4. synaptic

synaptic, formerly raptor, is a GUI frontend to apt-get. It is friendlier (or at least prettier) to use, but suffers from the same limitations as apt-get. It also has a fairly robust, though slightly confusing, means of filtering the package list displayed.

3.2.5. stormpkg

Originally created for the now-defunct Stormix, stormpkg is a GNOME-based APT GUI which can handle full dependency management, package list filtering based on package name or description to ease the search for particular packages, and it can edit the sources.list file. It seems friendly, but still has some stability issues to work out, like not crashing when someone double-clicks on a package name.

4. Adding to the system.

Once in a while you'll find some piece of software, or a particular version of a program, that has no corresponding deb package. What now? You can either put it in the system as a local addition, or roll your own deb.

Debian packages will never overwrite anything in /usr/local, so this is where you should put all software with no corresponding package. Most of the time, autoconf scripts default to /usr/local as the install location, so './configure; make; make install' is often all that is needed to install a program.

If you do want to make your own package, the easiest way to do this is usually dh_make, a part of the debhelper system. Start with a regular source tree, run dh_make from within it, and then you can edit the control files, preinst and postinst scripts, changelog, and other package information files. All package files are located in the debian directory in the source tree. A package can be built by running debuild from within the source directory. See the policy manual ( http://www.debian.org/doc/debian-policy/ ) for more information on package building.

5. Miscellany
5.1. init scripts

Debian uses a System-V init system. Init scripts are marked as configuration files in packages, so scripts that you add will never be accidentally overwritten by new packages (at least not without prompting you first). Init scripts are located in /etc/init.d, and may be added to the runlevels either by making the symlinks in /etc/rc?.d by hand, or by using the update-rc.d tool.

5.2. menus

Debian uses a collection of menu configuration files to generate menus for the various X window managers, so that packages can create menu entries without needing to know anything about each menu system. Packages place files in /usr/lib/menu. These files may be overridden globally by placing files in /etc/menu, or on a per-user basis with files ~/.menu. The menu files are generated from the menu configs by update-menus. See the documentation to the menu package for more information on the menu file format. Menu entries may be created for locally added programs by creating a menu file using the name "local.foo" for the package name, where foo may be anything. Any local.* package name is assumed to be always installed.

5.3. kernel modules

modconf allows you to choose modules from a menu, attempt to load them into the kernel, and then will set things to automatically load the module on boot. All it does is add the module name to /etc/modules, and possibly create a file in /etc/modutils if any special options are needed. The files in /etc/modutils are concatenated together to form /etc/modules.conf, a task handles by update-modules.

5.4. alternatives

Sometimes more than one program may be installed that handles the same or similar functions. Debian allows you to choose one of these to reference by a simple name through the alternatives system. For example, you may have nvi, elvis, and vim installed on a system, and you would like to able to type 'vi' and run vim. What Debian will do is create a symlink in /usr/bin/vi to /etc/alternatives/vi, which will in turn be a symlink to /usr/bin/vim. You can change the mapping of the alternatives either by changing the symlinks in /etc/alternatives by hand (the packages will detect when this has happened and not overwrite them when the packages are updated), or you may use the update-alternatives program. See the man page for details.

6. Resources