A couple of posts back, I touched briefly on how I personally install Debian Linux. With a little know how (this post), Debian becomes a far better advertisement for Linux than Ubuntu is, as Ubuntu is no faster than Windows. In fact, Ubuntu out of the box on my computer (Intel E8500, 4GiB of 800MHz RAM, etc) is actually a lot slower than Vista out of the box and as long as you can maintain Windows (i.e. not filling it up with crap), Windows stays in the lead for performance.
For the sake of this post, I will be installing Debian onto a 64bit VMware Server 2.0 virtual machine. If you do this, make sure that if you want sound, you add virtual sound hardware when creating the virtual machine, as I forgot (I’m sure previous versions of VMware added them by default).
Stage 1
Installing Debian is a 2 stage setup, as far as we are concerned. The first part is the actual installer, which takes us up to a working command line install of Linux, perfect for use as a server. The next part installs the applications we want to use as a desktop/laptop computer from the command line and ends in a working graphical desktop. Before we can start, we need to grab the netinst disk image and burn it to a CD (in the case of vmware, simply mount the iso file inside vmware).
To start the install, we turn the machine on with the disk in the drive and boot off it. This takes us to a menu, asking us if we want to do a text install, a graphical install (this menu option is new to Debian 5, though it was available from an “expert” mode before) or other options. I will choose the text install as that is what I am used to, though the graphical install should look quite similar.

The Debian installer will prompt us for our language, keyboard layout, locale and so on. This is fairly self explanatory so I will leave it to the reader.
After this, we are asked how we want to partition the hard drive. The easiest thing to do is make sure that you have a block of unallocated space and just use the guided install for unallocated space. You can always go back and change things later if you want to, such as adding a /boot partition or removing a /swap partition. As I am using a new virtual machine with a completely blank disk, I am using the option of “Guided – use entire disk”. You don’t need to wipe your hard drive to install Debian and it is a good idea to set it up before installing with GParted if it is a disk that you already have data on. Just leave a hole in the partition table with GParted and install Debian to that unallocated space in guided mode.
If you are dual booting with another operating system such as Windows, I recommend that you add a 100MB ext2 /boot partition to the start of the drive. This is where GRUB will be installed to and having its own partition means that you can change to a different distribution of Linux or even remove Linux entirely and still keep the ever-useful GRUB on there, with tools like memtest86+.
Remember that you can probably only have 4 primary partitions on 1 drive and that you may want to use an extended partition containing 1 or more logical partitions for the 4th. This is a limit of IDE hard drives but most partitioning software and most SATA hard drives respect this limit.

When you are done, it will ask you twice to confirm that you want to write these changes to the disk:

It will then install the “base system” to the hard disk. This includes things like the Linux kernel and other packages essential for the operating system. If you get the business card CD rather than the netinst CD, you will need to set up your networking before this in the install because they are not on the business card CD and must be downloaded during the installation.

After a few minutes, the base system will be installed and you will be asked to set up user accounts. First, you need to set a root password and confirm it. After this, you enter your full name, user name and user password. You will usually be using this user name and password for Linux, switching to root only when you need to make changes like install new software, usually by use of the “su -” command.

Assuming that we are on the netinst CD, we now set up networking so that we can install any additional packages. I suggest that you install using an Ethernet cable and DHCP, as wireless generally doesn’t work on Linux until you have installed some firmware such as ipw2200 (for Intel 2200 wireless adapters), b43 (for Broadcom wireless adapters), madwifi (for Atheros wireless adapters), etc.
Next, we pick a mirror to download the packages from. If ftp.uk.debian.org does not work for you for some reason or is slow, try using mirrorservice.org. If your ISP is Virgin Media, you may want to try debian.virginmedia.com for an even faster download.

This is where my guide gets different from any other guide you may see for installing Debian. At the task selection menu (tasksel), we deselect everything. These tasks tend to be bloated with random things that don’t even match the name of the task and even if you think one sounds like you want it (such as “Laptop”), you are probably better off installing the individual packages later on in stage 2 of this guide.

Because we have removed everything from the list, only a few small packages need to be downloaded and installed. To be honest, I don’t know why any have to be, as we didn’t select any tasks but that just goes to show how tasksel always gives you far more than you want.

All that is left to do is to install the boot loader, GRUB, to the master boot record of the hard drive. This is what will give us a choice of operating system to run when we turn the computer on each time, assuming that we boot off this hard disk by default.

That’s it for stage 1 and it probably took under 5 minutes to install Debian Linux to your hard drive. Now we can take the CD out of the drive and reboot the machine to the hard drive that we just installed GRUB to.
Stage 2
When we reboot the machine, we see GRUB giving us a choice of Debian or Debian (single-user mode). Single user mode is similar to safe mode in Windows. You only really need to use it if the standard mode does not work. If you want, you can remove it from your /boot/grub/menu.lst later and just press “e” from GRUB to edit the normal mode and add “single” to the kernel line if you ever need single user mode. If you have Windows installed on your computer, it should also have an entry to let you use that and you can change it to the default option inside the menu.lst file if you want, as well as setting the timeout.

A few seconds after selecting Debian from GRUB, the operating system has loaded entirely and we are at a login prompt. Because we did not install anything, it is all text based at the moment. This would be useful for a server but we probably want a graphical desktop. I’ve tried using a text-only desktop before and it isn’t pretty.

You should log in with your main user account and password then, once logged in, run the command “su -” and enter the root password to gain super user access. In a Linux command prompt, password fields do not display anything when you are typing them, not even asterisks (*). When you are in a root shell, the prompt should change from a $ to a #.
The first thing to do is add the non-free and contrib repositories to apt. You can use an editor such as vim or nano to edit /etc/apt/sources.list to remove any CDROM lines and add “contrib non-free” to the main Debian repository. I don’t add it to the main deb-src or to updates and as of yet I haven’t worked out what “volatile” is, as it is new as far as I know. Here’s what the file should look like in vim, with the new text highlighted in red:

You should then run
# apt-get update
to download the latest package lists, followed by
# apt-get dist-upgrade
to upgrade all existing packages, such as the kernel to their latest versions. A reboot may be required here, which you can do easily with # reboot (you can shut down from the command line with # halt).

Now we can begin installing the software to transform this command line into a graphical desktop, using # apt-get install <list of packages>. We want to install xorg, the graphics backend and frontend; gnome-core, the simple package for GNOME that comes with no large applications; gdm, the desktop manager for GNOME that lets us log in from a graphical interface among other things; alsa and alsa-oss for the sound and iceweasel for a web browser (this is firefox really). Other options are gnome-themes for some pretty window borders and gnome-backgrounds for some nice desktop wallpapers.
This will start to download and then install all of these packages, which may take a while depending on your internet speed but you are downloading them now rather than downloading the massive list of CDs or DVDs that you would have downloaded if you hadn’t have used the netinst or businesscard CDs, which will usually contain old packages that need updating anyway.

Once everything has successfully downloaded and installed, you can start gdm for the first time to turn on the graphical interface. This usually happens automatically on startup so you shouldn’t have to do it again. The command to start the gdm daemon is:
# invoke-rc.d gdm start

As soon as this starts, you should see a graphical login prompt:

From here you can choose alternative languages, switch between GNOME, KDE, Xfce and so on.
After you log in you should see a working graphical desktop and the installation is complete (ignore my broken sound, I forgot to add a sound card in vmware):

This is what you would expect from a fresh install of ubuntu but you should notice that it is very snappy and probably takes 30 seconds or less between turning your computer on and having a completely loaded working desktop, without even having to wait for a busy cursor before you can start doing things.
You can watch videos with totem-gstreamer, browse the internet with iceweasel, check your emails with icedove (thunderbird), write code or text files with gEdit, view PDF documents with evince, edit Microsoft office documents with OpenOffice.org, etc.