The Debian Universe


/read/online

^contents

3: Installing Debian

The ugliness of the Debian installer is one of those topics that rears its head on mailing lists at regular intervals, causing a short-lived flamewar that doesn't resolve anything. It's generally considered just a law of nature that the Debian installer sucks. Some developers even think it's good to have an installer that's hard to figure out, because it prevents Debian being used by the great horde of unwashed masses who aren't worthy of such a fine OS!

Fortunately that sort of attitude isn't very widespread, and there is actually a lot of work being done at the moment on the next-generation installer. Installing Debian should be a much nicer experience in future.

For now though, I'm going to run you through the process of using the current standard Woody (Debian 3.0) installer.

In my experience, installing Debian can vary from being in a walk in the park to a descent into kernel module hell. How hard it becomes depends almost entirely on your hardware and whether you want to take advantage of advanced features. If your hardware is moderately recent and you don't want to do anything too fancy right away, you should be able to work your way through it with out too much difficulty as long as you are aware of some little traps along the way.

Automatic Installation: The Chicken Method

One amusing comment I heard a while ago was that claims of the installer being hard to use are bogus, because even a chicken could install Debian: all you have to do is keep hitting [enter] and it'll pick reasonable defaults for you. At first I thought the claim was total hooey, so just for the fun of it I decided to try it for myself. I grabbed a standard Woody CD (disk 1 only) and chucked it in a spare machine along with an old hard disk, rebooted and started hitting [enter] at every prompt except where I absolutely had to type something different to make the system work. Here's what happened:

[enter] x 4
run fdisk to partition disk
[enter] x 17

Not bad at all! Assuming you could train a chicken to drive fdisk, you could safely turn Debian installation over to your feathered friend.

Getting The Installer

Probably the simplest way to get hold of the installer is to buy a CD. The full Woody install is 7 Cds, but you really only need the first one unless you've got a very slow or expensive Internet connection, because all the extra packages can be installed straight off the Debian mirrors via the Internet. You can buy CDs online at places like Linux Central[1], Cheapbytes[2], and EverythingLinux[3] for around US$15 / AU$30, which will snag you all 7 disks. Some vendors, such as EverythingLinux, can also sell you just the first CD or even the whole set on a single DVD if you prefer.

Alternatively, you can download an ISO image of the first disk and burn it yourself. Images are available from sites such as LinuxISO.org[4].

Jigdo: The Jigsaw Downloader

If you or a friend is already running Debian, you can create a local ISO image using a tool called Jigdo. Jigdo uses a '.jigdo' file that defines what should be on the CD, and is essentially a 'recipe' that tells it what to include. It then works through the recipe and downloads the listed packages from a mirror, then builds an ISO image on the fly on your machine. You then burn the ISO to a CD to create your own installer.

The reason Jigdo was developed was that ISO images are normally very large, and not many mirrors carry them. Many people also have problems downloading such large objects.

Jigdo avoids those problems because the mirror doesn't need to carry any images: it just carries the normal packages, plus the small .jigdo text files that define what should go on each ISO image. They can therefore effectively carry a huge number of 'virtual' ISO images, because each one is built on the fly by client machines and can all refer to the same packages. There is almost no space penalty to carry .jigdo files for lots of different images.

Running The Installer

The current Debian installer is probably the number one reason cited for Debian not being a more widely used Linux distro. However, there's no reason to be scared of it: it may not be as pretty as the graphical installers for many other distros, but it's not actually all that hard to get through if your hardware is relatively decent (read: "well supported").

However, many of the questions and prompts are a bit hard to follow, and there are some spots where it throws you in the deep end without much explanation (such as partitioning your disk). It's not really a newbie-friendly as it could be.

Don't be put off though: once you are through the installer and have Debian going, the initial pain is worth it. If you grin and bear the initial bitterness, there's a sweet gooey center.

It actually takes longer to read about the installer than to use it: my record for installing a Debian system from scratch is about 8 minutes from start to finish, and most of that was spent sitting watching the installer decompress the packages!

Assuming you've got yourself a copy of at least Disk 1 of the installer by one of the methods above, power up your computer and pop it in the drive. If your computer is not set to boot from CD, you may have to go into your BIOS setup (press "Del" while the computer is booting) and set the first boot device as the CD-ROM drive.

If the computer has booted successfully from the CD, you'll end up at a screen that says "Welcome to Debian GNU/Linux 3.0!" and has a prompt at the bottom that just says: "boot:".

At this point you can decide what kind of install you want to do. The safest and most conservative route is to do a standard install with a 2.2 series kernel, and that's the default that will happen if you just press "Enter".

However, there are a number of other install types that you can choose from. If you want to see an explanation of the options press "F4".

In this walkthrough I'm going to choose an installation that uses the more modern 2.4 series kernel. To do that, type "bf24" at the "boot:" prompt, and press "Enter". From this point on I'll assume you're doing a bf24 install, but the process is pretty much identical for other install types so if you choose a different type you can still follow along the rest of the steps with me.

The next thing you'll see is some cryptic text flashing by as the installer loads some things. Ignore that, and after a couple of seconds you'll see a blue screen with "Choose The Language" at the top. The default option (Catalan) probably isn't much use to you, so use the arrow keys to move down to "en" (English) and press "Enter".

If you picked English, the next screen will ask which type of English (UK, US or Irish). Select your preference and press "Enter".

Next you'll see a screen titled "Release Notes", with a blurb about Debian and SPI (Software in the Public Interest). No options here: just press "Enter".

The next screen you see is the actual installation menu, and this is where things can become a bit confusing. Unlike most installers which take you through a sequence of steps one at a time, the Debian installer actually displays a menu of all the things you can possibly do. The bottom half of the screen is all the tasks you can choose from at this point. This freedom can be very powerful for advanced users who know what they are doing, but can be confusing if you don't know what you should do next. However, to make the process simpler for beginners the installer recommends the next action to perform at the top of the screen, and most of the time you can just accept the default recommendation to step through the actions in a logical order.

The first recommended action is to configure your keyboard, and that's a good place to start so just hit "Enter".

Keyboard

You'll now be at a screen that asks you to select a keyboard. The default option is "qwerty/us", which is the right choice for most people ("qwerty" just refers to the layout of the keys on the keyboard, and "us" means it will use symbols relevant to the US, such as a dollar sign rather than a pound symbol). If you want some other variant you can select it here, such as "qwerty/uk" to have a pound sign rather than a dollar sign. Personally I use a Dvorak layout which re-arranges the keys to make typing more efficient, so I'll choose "dvorak/dvorak" and press "Enter".

Setting Up The Disk

What you do next will depend on how your disk has previously been used. If you've already had a Linux distro on the disk and you are just replacing it with Debian, you probably already have the necessary partitions and can just let the installer initialise a swap partition.

However, I'm going to assume your disk is either brand new and has no partitions on it, or was previously used for a different purpose and needs to have its partitions changed.

Use the arrow keys to select "Partition a Hard Disk" and press "Enter". It will then ask you to select the disk to partition. If you only have one disk installed you can just press "Enter". Otherwise you will need to select the disk. In Linux on a standard PC platform with IDE drives, the disks are labelled as follows:

Primary master: /dev/hda Primary slave: /dev/hdb Secondary master: /dev/hdc Secondary slave: /dev/hdd

In almost all cases it will be the primary master you want to use, so select "/dev/hda" and press "Enter".

Next you'll see a screen going on about LILO limitations. It will probably look like double-dutch to you so just ignore it for now and continue on. We're going to set the partitions up in a way that avoids the problem it's talking about anyway.

If you are using the "bf24" install type, you'll see a screen telling you some things about ReiserFS next. Other install types probably won't show this screen at all. Continue on.

Next we come to a little program that is probably the nastiest part of the install process: cfdisk. The screen will be black, and you'll see a list of partitions on your disk. If the disk is new, the list will be empty except for an item listed as Free Space.

The way to drive cfdisk is to use the up and down arrows to select the partition you want to act on, and the left and right arrow keys to select an action from the menu at the bottom of the screen. If you need to delete old partitions to create new ones, select each one in turn, then select "[Delete]" at the bottom and press "Enter". After you've deleted all the partitions, you'll end up with only Free Space in the list.

Now, there are many ways you can partition a disk depending on what you will be using the computer for. Servers often have separate partitions for different purposes, for example. However, I'm going to keep it simple by using a very basic partitioning scheme.

Creating A Boot Partition

First we'll create a small partition at the start of the disk to hold the kernel image, etc. This is to avoid any possible problems with the bootloader not being able to find the kernel and therefore not able to boot your computer. With the Free Space item selected, move to the "[New]" menu item and press "Enter". Next it will ask you what type of partition to create: select "[Primary]" (the default) and press "Enter". Next it will ask for the size of the partition, and will have pre-entered a default that will use up the entire disk. We don't want that, so type "50" (no need to delete the default, it will just vanish) and press "Enter". Next it will want to know where to put the partition: select "[Beginning]" and press "Enter".

The final thing to do for the boot partition is to flag it as bootable: select the first partition and "[Bootable]" and press "Enter". You'll see an entry called "Boot" appear under the "Flags" column.

Creating A Root Partition

Next we'll create the root partition, which is the main partition that will hold most of your filesystem.

Use the arrow keys to select Free Space, move across to "[New]", and press "Enter". Select "[Primary]" as before. Next you need to set the size: once again we need to change the size, but first pay attention to the total space available. On my 80GB disk it shows 79974.40 MB available after creating the boot partition. We need to leave some space to make our third and final partition, so take about 1000 off the available size (no need to be precise) and enter that amount. I'll type in 79000 here. Now press "Enter".

Select "[Beginning]", press "Enter", and you're done for the root partition.

Creating A Swap Partition

The last partition is the swap partition, which is the space on disk that Linux will use to store items that can't fit into memory. This is often referred to as "virtual memory".

You know the procedure by now: move down to Free Space, select "[New]", then select "[Primary]". Next is setting the size. This time we just want it to use all the space left on the disk, so leave whatever default it puts in there, but check that it's about 1000: if it's way off, you may have made a mistake setting the size of the root partition. Press "Esc", delete the root partition, and create it again. If all is well, just press "Enter" to have it create the final partition.

One other thing you need to do now is change the type of the swap partition: it uses a special partition type, but cfdisk will have created it with the default type. Make sure it's selected in the list, then move across to "[Type]" but remember to only use the left and right arrows: it's on the second row of menu items, but if you use the up and down arrows you'll just change the selected partition. The menu items wrap at the end of the line.

When you have the last partition and "[Type]" selected in the menu, press "Enter". You'll see a bewildering list of partition types listed in hexadecimal notation, but the one you want is type 82 (Linux swap). Press any key to exit the list and go to a prompt that says "Enter filesystem type:". 82 is probably already selected for you since it's the most common choice but if it's not, just type 82 and press "Enter".

You'll then be returned to the main cfdisk screen, and you should see the last partition has now been changed to type "Linux swap".

Do a final sanity check on the partitions: make sure
o There are 3 partitions in total and no free space
o The first 2 partitions are of type "Linux"
o The first partition has the "Boot" flag set and is about 50MB
o The last partition is of type "Linux swap" and is about 1000MB

If there are any mistakes, go back and correct them now. If necessary, just delete the partitions and start again.

This is the moment of truth: the point where the disk is irreversibly changed, and previous data may not be recoverable. If you change your mind totally at this point you can select "[Quit]" to bail out of cfdisk without saving your changes.

However, if everything looks OK and you want to go ahead with the changes, select "[Write]" in the menu and press "Enter". You'll then see a scary looking warning to confirm that you really want to do it. Type "yes" in full and press "Enter" to commit the changes.

After a few seconds of disk activity you'll end up back at the cfdisk main screen. Select "[Quit]" from the menu now, and you'll be back in the main Debian installer menu.

Initialising The Swap Partition

At this point your partitions have been created, but they don't actually have any filesystems on them. The next thing the installer will want to do is initialise the swap partition you just created, so select "Initialise and Activate a Swap Partition" and press "Enter". Next it will ask if you want to run a bad block scan: it's not needed on modern hardware, so just choose No. It will then ask if you're sure about initialising the swap partition: say Yes.

Initialising The Root Partition

The next option will be "Initialise a Linux Partition". Select it and press "Enter".

What options you get here will depend on which install type you chose. If you selected the default install you don't have a choice of filesystem types because only Ext2 is supported, but with the bf24 install type I selected you will have options now to choose some more advanced alternatives: Ext3 and ReiserFS.

Ext3 and ReiserFS have some major advantages over Ext2, including a feature called journaling. Journaling can provide benefits such as greater reliability, easier recovery after crashes and unexpected resets, and greater performance in some situations. Ext3 is really just a journaling layer that runs on top of Ext2, so is very popular with users who want to migrate from Ext2 to a journaling filesystem. However, my personal favourite is ReiserFS because it provides some performance advantages over both Ext2 and Ext3. Since we're doing a new install here and not trying to convert an existing Ext2 partition, I'm going to choose the most advanced option: ReiserFS.

Next you will see a list of available partitions to use as the root partition. The first one (/dev/hda1) is the partition we created as the boot partition, so we don't want that one. Select the second (/dev/hda2) and press "Enter".

Once again we can skip the bad block scan, so choose No on the next screen. Finally the installer will check whether you are sure about creating the filesystem: choose Yes.

Next you'll see some disk activity for a while and some text will scroll by. Once the filesystem has been created, the installer will ask if you want to mount it as the root filesystem ("/"). Choose Yes, then wait while it does its thing.

Initialise The Boot Partition

At this point you'll be back at the installer menu, but this time we're not going to accept its recommendation for the next step: instead, move down to "Initialize a Linux Partition" and press "Enter".

This is basically a repeat of the initialising the root partition, but this time just select Ext2 as the filesystem type: once the machine has booted it's not really needed anyway, so it makes sense to use the most commonly supported filesystem type in case you have to make repairs with a basic boot floppy at some point. Besides, for ReiserFS the journal alone would almost fill the 50MB partition!

Choose No for the bad block scan, choose Yes when it asks if you're sure, and then you'll see a screen asking you to select the mount point.

We want this to be the /boot partition, so select that and press "Enter".

Installing The Kernel

Woohoo, we're finally getting to install something! Your disk should be all set up now, and the next item in the installer should be "Install Kernel and Driver Modules". Select it and press "Enter".

The next screen will tell you that it found a Debian CD-ROM that contains packages, and give you the option to select this disk as the primary installation source. Select Yes.

The installer will flick through a couple of information screens, then take you back to the main installer screen again.

Device Driver Modules

The next option is "Configure Device Driver Modules". I'm not going to go into this in detail, because most common drivers are already in the kernel and there are so many possible variations that I couldn't cover them all anyway. If you've got fairly normal hardware you shouldn't have to do anything in this section, so you can just skip it.

If you do need to install specific modules, you can use this section to navigate to different module categories, select specific modules, specify any arguments that need to be passed to them, and install them.

Configure The Network

Next we need to configure the network. If you don't have a network connection you can skip this step, but almost all Debian machines will have some kind of network connection so select "Configure the Network" and press "Enter". The next question is what hostname to use. If you know what hostname your machine should use, enter it here. Otherwise, just leave it as the default ("debian") and press "Enter".

Next the installer will ask if you want to use DHCP to obtain the network settings automatically. If you've got a DHCP server on your network select Yes, otherwise select No.

If you select Yes and the machine can find the DHCP server, the rest of the setup will be done automatically for you.

If you select No, you will have to enter some network settings manually. The first thing is the IP address: if you know what setting to enter, do so now, otherwise just accept the default. Same goes for the next couple of questions about netmask, gateway, domain, and nameservers.

Install Base System

The next suggested step is "Install the Base System". That's exactly what we want to do, so select it and press "Enter". The installer will then show you a progress bar as it runs through and installs some core packages that are used to bring your disk up to a bootable state so the rest of the system can be installed. There's not much to do at this point but sit back and watch for a few minutes.

Make System Bootable

Back at the installer menu, the next step is "Make System Bootable". Select it and press "Enter".

The next question can be a bit cryptic if you don't know about boot loaders. Debian uses the LILO (LInux LOader) boot loader by default, and it can be installed into either the master boot record or the boot partition. Assuming you don't have any special requirements such as using a different boot loader, go with the default: installing LILO into /dev/hda, which is the master boot record.

You'll then see a screen warning you about the dangers of the default LILO configuration. If your computer is going to be in a fairly safe place (we certainly hope so!) you probably don't need to worry about this. If your computer is going to be placed somewhere that untrusted people will have physical access to it, such as in a classroom or Internet cafe, you can change the LILO configuration to make it more secure.

Either way there's nothing you can do at this point: it's just a warning. Select Continue.

Making A Boot Floppy

A boot floppy can be used to reboot your machine for repair in the event your hard disk gets totally hosed, and the installer will give you an option next to create one. None of my computers actually have floppy drives in them and it's usually possible to boot from CD into a rescue mode anyway, so I never personally bother with this step.

Instead, move down to "Reboot the System" and press "Enter".

Rebooting Into Debian

The next question asks if you really want to reboot your computer. At this point you should have a system that's ready to boot up directly off the hard disk, but you'll still have the install CD in your CD-ROM drive so if you reboot you'll just start the installer all over again! Unfortunately the system won't actually let you eject the CD at this point because it's mounted by the installer, so choose "Yes", but press the CD eject button as the machine restarts to force it to eject the CD.

After the CD has been ejected, your computer should start to boot Linux directly off the hard disk. Congratulations, we're nearly there!

Once it finishes rebooting you'll see a screen congratulating you on installing Debian, and telling you that it is now going to take you through the setup process. Select "OK".

Before you go any further, though, open the CD-ROM drive and put the install disk back in. We'll need it again in a few minutes to install some more packages.

Setting The Time Zone

Next it will ask you an obscure question about GMT and time zones. If this is a purely Linux machine just choose the default ("Yes") and move on.

The next couple of screens let you specify your location. Choose your country from the list, or if it's not listed there, choose "None of the above" to enter the timezone offset directly. I'm in Australia, so that's what I'll choose. The next screen lets you narrow down your location within the country: I'm in Melbourne, so I'll choose that.

Users And Passwords

The next screen asks if you want to use md5 passwords. Unless you've got reasons not to, choose "Yes" rather than the default.

Shadow passwords are generally A Good Thing, so at the next screen choose "Yes" to enable shadow passwords.

Next you need to select a root password. This needs to be a strong password, not something simple like the name of your pet. You also need to make absolutely certain you remember it, because you can't recover it later. There are ways to reset it if you absolutely have to, though. Once you've picked a root password, type it in and press "Enter".

You'll then be asked to type the same password in again to make sure you didn't mis-type or anything at the last screen. Do it and press "Enter".

The system will now allow you to create a normal user account. In Linux you do almost everything as a normal user, not as the root user, so select "Yes" here and then enter a username and password for the account when prompted.

Remove PCMCIA

Unless you are installing on a laptop you probably don't need PCMCIA packages even though they are installed by default with the kernel, so the installer will ask you now if you want to remove them. Select "Yes" unless you are using a laptop.

Setting Package Sources

The Debian installer can use PPP to connect to an ISP to retrieve packages, but we're going to use the install CD for now so at the next screen where it asks about using PPP just say "No".

The installer will then look in your CD-ROM drive for the install CD. If you followed my advice a few minutes ago and put it back in the drive after the machine rebooted, the installer will find it and all will be well. It will scan the CD for packages, then ask if you want to scan any more CDs.

If you have more CDs, such as additional disks in a mult-disk set, eject the first disk, put the second one in and select "Yes". When you're finished scanning disks, select "No".

Next the installer will ask if you want to add another Apt source. If you only want to use the packages on your install CD, select No and jump to the next section about using security updates. If you want to be able to install packages off the Internet, select "Yes". Most people should say "Yes" here.

If you said "Yes" to the last question, the installer will ask you what connection method to use. Choose "http" and press "Enter".

The next screen will ask if you want to use non-US software, which is software that cannot be distributed within the US for various reasons such as cryptographic controls and patent restrictions. I'll choose "Yes" here, because there's a lot of security related software that's only in the non-US section of Debian.

Next is a question about using non-free software. Debian itself is very focused on including only software that falls under Open Source licenses, and if you want to stick to truly Open Source software you should say "No" here. There are a lot of useful packages that can't be distributed under an Open Source license though, so I'll say "Yes".

Likewise for the next question about using "contrib" (contributed) software, which may be free itself but depends on non-free software to work. I'll say "Yes" here.

Next you need to choose the closest mirror to use for downloading packages. Move to the closest country and press "Enter", then choose the closest mirror. If you have a local proxy server enter it on the next screen, otherwise leave it blank and press "Enter".

The installer will then try connecting to the mirror you specified to make sure the settings are valid and the network connection works.

If all is well, you'll end up back at the screen asking if you want to add another Apt source. Unless you want more sources, select "No" and move on.

Using Security Updates

The installer will then ask if you want to use security updates from security.debian.org. If your computer has access to the Internet, select "Yes". Once again it will go off and check that it can actually access the server before moving on.

Tasksel

There are a lot of packages in Debian, and it can be used for all sorts of different purposes. Setting up a computer to do various tasks can involve installing many different pieces of software. Tasksel (short for Task Selector) is an attempt to simplify this process for typical uses. If you want a basic, minimal installation to which you can add packages as you go, select "No" to skip tasksel and go down to the section on Dselect. My personal preference is to not use it, and to just install packages as they are required. However, if you want to be able to specify a broad category of task such as "file server" or "games", select "Yes" to run tasksel.

Tasksel will show you a list of tasks to install. Move up and down the list with the arrow keys, pressing the space bar to select or deselect options. When you are finished, use the Tab key to select "Finish" or just press "f". Nothing will actually be installed just yet: tasksel just flags groups of packages to be installed later.

Dselect

Dselect is a more fine-grained way to select packages to be installed. If you run dselect you can go down to the level of individual packages and select or deselect them for installation.

Dselect is one of the most notoriously unfriendly programs in Debian, and while many people swear by it there are far more who swear at it. My recommendation at this point is to select "No" to skip dselect until you've got a bit more experience with Debian.

Installing The Packages

At this point Debian will have a list of packages that need to be installed, either as a result of choosing tasks in Tasksel or specifying packages in Dselect. It will print out a list of packages and tell you how much data it needs to fetch, and ask if you want to continue. To accept the default "Y" answer, just press "Enter".

If any of the packages will be coming off the install CD it will prompt you as required to make sure the right CD is in the drive and press "Enter". You'll then see it work through the list of packages, downloading them all before configuring and installing them.

As various packages are configured you'll be asked questions about how you want them set up. I can't step you through this process because I don't know what packages you've selected, but if you read the cryptic questions carefully you should be able to figure them out. I'll cover a few of the common ones that you'll almost certainty see, but in most cases you'll find the Debian developers have selected safe defaults so you can probably just accept most of the answers that are preselected for you. If in doubt, use the default option.

One annoying prompt that often comes up at this point is a message about kernel link failures with binutils. Don't stress about it, the only option is to hit "OK" anyway so just accept it and move on.

When you see a screen that asks you to select locales to be generated, just use the Tab key to select "OK" and press "Enter". Locales are part of the internationalisation effort and can provide some useful local customisation, but I'm assuming you're based in Australia or the US so you can skip them for now. The next screen, where you set the default locale, can generally be left as "Leave alone" as well.

Depending on what you chose in Tasksel and Deselect, you'll probably end up at a screen saying it can do automatic configuration of your mail system. It will give you 5 options to choose from. The most common choice will be to select option 1, or option 4 if you don't have a network or Internet connection. You can probably just keep pressing "Enter" through all the default options until you get to a question asking which user should receive root's mail. At this point type in the username of the normal user you created earlier.

What Next?

Assuming all went well so far, you should now have a fully functioning Debian machine Ð albeit a bit light on for applications and probably without a graphical interface, unless you selected some tasks or packages using Tasksel and Dselect. You'll end up with a blue screen that thanks you for choosing Debian, and telling you that you can now login at the login: prompt. Press "Enter", and you'll end up at the command prompt, ready to log in and start using your system.

Stay tuned for future installments, where I'll show you the basics of installing software packages under Debian and step you through installing the X graphical user interface!

1 www.linuxcentral.com
2 www.cheapbytes.com
3 www.everythinglinux.com.au
4 www.linuxiso.org


Errata/Addendum: This is stuff I still need to incorporate into the main text, stuck here so you know it's not forgotten (and so I don't forget it!)
dselect also, and also that they skip the kernel module configuration
step, since most hardware is supported without any.  I tell them that
the first command to type after base-config is complete should be:

 apt-get install discover aptitude hotplug

... then type "aptitude" and use it to perform package management tasks
from then on

Karl M. Hegbloom
Copyright 2003-2004Jonathan Oxer. All rights reserved.
-:Site powered by Internet Vision Technologies:-