Note: Assuming your browser supports it, this list will not be printed out. Hide navigation

Installing Debian Sarge

Friday 30th September 2005


Debian is one of the most common Linux distributions in the world. With a possible total of fourteen CDs, it is also one of the biggest. As you may have gathered from the fact that this guide exists, Debian is not the easiest Linux distribution. However, anybody that is relatively competent with computers should be able to use Debian (after all, I am!), and this guide is here to help you get started.

When you go onto the Debian website, you will find three possible versions you can install. At any point, there are three main choices: stable, testing and unstable. Stable is regularly released, with the packages staying the same throughout that particular release, apart from security updates. This is best if you want the versions of packages to be consistent and, unsurprisingly, if you want absolute stability. The current version is 3.1, otherwise known as Sarge.

Next up is testing. This next version is named Etch, and the packages within are regularly updated, and should be relatively stable - I use packages from testing, and my system never seems to crash! Finally, we have unstable, which is always called Sid. In case you didn't realise, these are all characters from Toy Story, with Sid being the 'unstable' kid next door. This guide is mainly concerned with Debian Sarge, although right now, the Etch installer is, to my knowledge, very similar.

To give you an idea of which of the three versions is best for you, knowing the relationship between the versions helps. New and updated packages are put into unstable. Once they have been there for a given amount of time, and have few enough bugs, they are moved into testing. They stay here until the next update of the package, or just before a new stable release. Before a new stable release, testing is frozen, and a bug fixing frenzy ensues. This results in the release of a new version, most recently Sarge. This guide is about Sarge since the installation shouldn't be changing anytime soon, and Etch should be pretty similar (for the time being at least).

Getting Started

Before we get going, there are a few things we need to do. The first is to make sure you have enough free space for Debian (or that you're happy to destroy a partition or two). I personally try and make sure that Debian has at least 10GB, although it's perfectly possible to run it on less.

Once you've found a spot for Debian, you need to start downloading Debian. At this point, you may start panicking about downloading fourteen CDs. Panic not! You only need the first CD to install Debian. This contains the most common packages, while the rest can be grabbed from the web. You can also download a CD for both stable and testing that contains only the basic packages, and grabs the rest of the packages from the web. It doesn't really make much difference which CD (or DVD) you choose, although I have the first full CD of Sarge so that I don't need to download packages repeatedly.

Once you've picked your CD (or DVD) and burnt it, you can begin. Stick the CD in the drive, reboot and make sure your CD drive is the first in the boot order. You should be presented with a black screen with a Debian logo, and the prompt:

Press F1 for help, or ENTER to boot:

At this point, we want to add an option to the standard installation. By default, Debian uses the 2.4 kernel, but I prefer to use the more recent 2.6 kernel. You can tell the installer to use the 2.6 kernel by typing linux26 before pressing Enter. This is especially important if you more recent hardware, such as a SATA drive. You can still use the 2.4 kernel if you wish; if you're uncertain, try the 2.6 kernel, and if that doesn't work (although it should), you can try the 2.4 kernel just by pressing Enter at this screen. After hitting Enter, you should be off!

Basic Installation

Next you should be asked:

Choose a language:

I use English, so, oddly enough, I select English. (Just for future reference - use the arrow keys and Tab to move around, the Enter key for when you need to select one item, and the space bar for when you need to select items from a list, in similar fashion to tick boxes). Next is our location; the screen should say:

Based on your language, you are probably located in one of these countries or regions.

Choose a country, territory or area:

That's the United Kingdom for me - so far, fairly easy! Next is the keyboard layout, with the screen stating:

Keymap to use:

Again, a relatively simple choice. The installer will suggest the one that makes the most sense, so it selected British English for me. Next, we have some network configuration. The instructions make good sense to begin with, so I'll just type them out again:

Please enter the hostname for this system.

The hostname is a single word that identifies your system to the network. If you don't know what your hostname should be, consult your network administrator. If you are setting up your own home network, you can make something up here.

See? Fairly sensible advice. I went for the wonderfully original name of penguin - I hope you can come up with something better! Next is the disk partitioning - the screen should read:

This installer can guide you through partitioning a disk for use by Debian, or if you prefer, you can do it manually. If you do choose to use the guided partitioning tool, you will still have a chance to see the results, customise it, and even undo the partitioning if you do not like it.

Now you can decide where to install Debian. Due to my already full disk, I have the choice of manual editing or erasing my entire hard disk. If you have some free space, you should also get the choice of using the free space. If you didn't choose manual editing, you should be guided through the process. The main two ways I normally install a system is either to lump it all into a single big partition, or as a 'Desktop machine'. For my own systems, I normally choose a Desktop machine. What this means is that the /home directories are kept separately from the rest of the system. The result is, if you decide to reinstall, you can keep all of your documents and most of your settings (at least the ones set on the user level). If you're still not sure, then having all the files on one partition is fine.

Next, you should be shown how the installer has distributed the space. You can change it around, although the installer tends to decide the spaces quite sensibly. I often leave far too much space for the root filesystem - about 10GB. This is to make sure I don't run out of room, especially since I barely use any in my home directory, but less than that is still plenty.

You can play around the different partitions - once you're happy, you can hit Finish partitioning and save changes to disk and you should get a screen that starts:

If you continue, the changes listed below will be written to the disks.

WARNING: This will destroy all data on any partitions you have removed as well as on the partitions that are going to be formatted.

That's your last chance to go back! Once you select Yes, you can wave goodbye to whatever was on your hard disk (assuming you're formatting over another installation).

Now the installer will ask:

Install the GRUB boot loader to the master boot record?

The message beforehand will vary as to whether you have another operating system on the system. If you do have another operating system, it should be listed. If it isn't, then you might want to stop here since you won't be able to get back into the operating system easily. Otherwise, hit Yes, and the installation will continue. You'll be asked to take your CD out, which you don't really need to do if you just change the boot order so that it boots from the hard disk rather than the CD drive. The next thing that should happen is... a reboot!

Basic Installation... Again

The next part of the installer should greet you with:

Welcome to your new Debian system!

Unsurprisingly, hit Ok to continue. The next question asks:

Is the hardware clock set to GMT?

If you're running Windows alongside Linux, you'll want to select No here; if you're just running Linux, Yes is the option you want. You'll then be presented with a list of timezones - just pick the one most appropiate to you. After that, you're asked for a root password. For those who haven't used Linux before, here's a quick diversion - those you that know what root is, feel free to skip ahead to the next paragraph. The root user is similar to Window's Administrator, except that the concept works much better with Linux. You should only be logged in as root when you need to - this includes installation of programs, and changing some configuration files. The rest of the time, you should be a normal user. This increases security, as well as reducing the chance of you destroying your system.

Right, on with the installation - enter your root password, and enter it again. Then you told to:

Enter a full name for the new user:

This could be Joe Bloggs, or Miss Flobadob, or whatever takes your fancy - the computer doesn't really mind if you don't use your real name or every middle name you have. You'll then be asked to:

Enter a username for your account:

This should be something fairly simple and easy to remember since you'll be using it every time you want to use the computer (at least under that account). You're then asked for another password, and to confirm it. Next is apt configuration. If you left the CD in the drive, the installer will start reading it. Otherwise, you'll have to select which method of obtaining packages you would like to use. If you want to pull packages off the internet, you'll want to use HTTP or FTP protocols. Try to pick servers near your location - hopefully, that will result in faster speeds.

After all of that, the computer will start testing the apt sources. If all goes well, the list of packages should be obtained, and the installation continues. You'll be asked what software you want to install. You can pick any options that take your fancy, but if you're following this guide to the letter, don't install anything yet - we want to be specific about what we install.

The installer should now happily start grabbing and installing packages. It should ask you to configure Exim after some time - specifically:

General type of mail configuration:

From the list, the default of local delivery only; not a network should be fine. You'll then be asked to pick the Root and postmaster mail recipient - again, the default value should be fine. Some more thinking by the computer, until, thankfully, you are told:

Setup of your new Debian system is complete.

Hooray! You can log in using the username you provided beforehand - don't log in as root - you should never log in as root. Instead, at a prompt such as the one provided once you log in, type su. You'll then be asked for a password, which is the root password you gave earlier. This effectively turns you into root - never do things as root that you could do as a normal user, such as browse the internet or chat online. To turn back into a normal user, simply type exit.

Installing Packages

Debian installs packages using a very useful program called apt. By typing apt-get install program1 program2 (and so on), apt will automatically work out what other packages are required to install the programs selected. Before we start installing packages, you can take a look at /etc/apt/sources.list. The easiest way to do this is to become root by typing su (to configure apt requires root privileges), and then nano /etc/apt/sources.list. (For those unfamiliar with Linux, everything starts at / - all other files and directories are stored within /, including CD drives and other partitions). If you supplied the CD, there should be a line that starts:

deb cdrom:[Debian GNU/Linux 3.1 r0a _Sarge_ - Official i386 Binary-1

This means that apt searches for packages from the CD-ROM. Since this does not include all the packages, lets add another line so that we can get packages from the internet. The Debian website has a a long list of mirrors. Since I am in Britain, I would add this line below the CD-ROM:

deb stable main contrib non-free

This line is fairly simple. The address is just that: the address for the packages. The next word refers to the version of Debian - you should make it match the version of Debian you have installed e.g. stable, testing, unstable. You can also refer directly to the codename of the version e.g. sarge, etch and sid respectively. The next three words refer to the various groups of packages - main, contrib and non-free. I would add all three so that you get the full range of packages, although you may wish to omit contrib and non-free if you want to keep your system completely open source.

Now that we have added the line, we can exit by pressing Control and X, choosing to save when asked. Next, we want to update apt by typing apt-get update. Apt will then fetch the package list from the new source. If it produces an error, make sure you have not made any errors within /etc/apt/sources.list.

So, what do we want to install? Well, the interface is still fairly sparse. Most people would want something beyond a command line, so we should try getting a graphical interface. The package we want is x-window-system, so, as root, type apt-get install x-window-system. X will prove to be very useful - it is the package that allows you to draw things on the screen besides text. After grabbing the packages, the installation process will ask:

Attempt to autodetect video hardware?

You may as well say Yes - if it succeeds, then it saves you working out which video driver to choose. Otherwise, you will be presented with a list of drivers. If it doesn't find the correct driver, we want to use a driver that is likely to work, rather than providing good, if any, 3D performance. As such, Vesa is probably the best bet for a driver. After this screen, you'll be asked:

Please select the XKB rule set to use.

The default (xfree86) should be fine, as it so often is. The next screen talks about selecting the keyboard model - for most people the default of pc104 should be fine; the previous screen should help you make your choice.

Now we are asked:

Please select your keyboard layout.

Since I'm the UK, the layout for me is gb - change it according to your keyboard.

There will be another two prompts, namely:

Please select your keyboard variant.

Please select your keyboard options.

Unless you want to add anything, leaving the options blank should be fine. Next, you are asked about your mouse. If you have a PS/2 mouse, select /dev/psaux, followed by ExplorerPS/2. If you have a USB mouse, go for /dev/input/mice. You are then asked whether you have an LCD monitor - I should hope you know the answer to that question yourself!

Read the next page about resolutions, and then make a choice - personally, I go for Medium. Choose your best video mode, and then use the space bar to select the resolutions that you want to be able to use. Read another page, then select the colour depth. Unless you have a very old graphics card, 24 bit should be fine.

Next is printer settings - the default should be fine. You can then read a page about fonts, followed by the question:

Do you want to trust font management to defoma?

Unless you have a special reason not to, then just select Yes. From here, the configuration should finish without a problem.

Next, we want something to draw. There are two main selections here: KDE or Gnome. If you're not sure which to choose, then I prefer Gnome, although they're both reasonably similar. If you want to use Gnome, type apt-get install gnome-core gdm. This installs the basics of Gnome - you can install more of the Gnome components by typing apt-get install gnome gdm instead. Similarly, you can use apt to install kde or kde-core along with kdm. Next, you'll be asked which window manager you want to use. Just select the one you just installed, whether it is kdm or gdm. You may also be asked some more questions, depending on what you installed - it should be fairly easy to answer the questions since the spiel beforehand is often very useful. If in doubt, use the defaults.

Finally, we want to start up our new graphical interface - type /etc/init.d/gdm start or /etc/init.d/kdm start, and you should be presented with a logon screen. Type in your username and password, and you should be flying! You can use the terminal to install more applications - see the next page for a list of just some of the thousands of packages you can install.

What Packages?

In Debian, there are thousands of package, from Unison to Mozilla Firefox. The list that follows includes some that I have used (my personal recommendations are highlighted) - of course, I highly recommend you try different packages to see which you like. One of the key points of Debian is freedom, so you have a huge range of packages to try - you can search using apt-cache search wordstosearchfor, or on the Debian website. You can read a quick manual on each package by typing man packagename once it is installed. Good luck, and have fun!

*You may find some packages in the internet as a file with a .deb extension. To install the package, type dpkg -i filepath.

Useful Links