How to install Debian GNU/Linux on your computer

From NewbieDOC


Chris Lale
chrislale AT users DOT berlios DOT de

Latest version

You can find the latest version of this document at http://newbiedoc.berlios.de.

Revision History

1.0 16th February 2007 Revised by Chris Lale
Initial release for Etch (Testing).
1.1 25th May 2007 Revised by Chris Lale
Added link to install CD/DVD vendors on www.debian.org.
1.2 14th June 2007 Revised by Chris Lale
Revised for compatibility with the Debian 4.0 Stable (Etch) installer.

Abstract This HOWTO walks you through the installation of Debian GNU/Linux using the graphical installer ("installgui"). It covers some common scenarios - complete over-write of everything on an existing hard drive, dual-boot with another operating system (eg Windows) and installation from CD/DVD and network ("netinst"). This article is based on the Debian 4.0 Stable (Etch) i386 installer.

Contents


1 Introduction

This article explains how to install Debian GNU/Linux on a new computer or a computer already containing an operating system like Windows. You can choose to remove Windows completely or to keep it alongside Debian. You can install Debian from CD or DVD, or from a network connection to the internet.

Installing from CD and replacing Windows completely is very easy. Setting up a dual-boot system, or installing from a network, requires a little more work but is still straightforward. For a net install, your computer needs access to the internet via a network card.

 
Note
Note: 
At the time of writing, there was a problem with the "netinst" CD. You can find more details about this on the Debian installer webpage [http://www.debian.org/devel/debian-installer/News/2007/20070210].
 

Two types of installation are covered.

Simple installation
This is the easiest installation but it erases your hard disc first.
Dual-boot installation
This keeps your existing operating system (eg Windows) providing that enough free space is available. After installation, every time that you switch on the computer, or reboot it, you can choose which system to use. The installer can shrink your Windows partition or you can fit an extra hard drive for Debian. Backup any important files first.

Two installation methods are covered.

Installation from a physical medium.
The installation medium is normally CD or DVD. You can use a complete disc set, but you only the first disc in the set to install Debian. The other discs are useful if you cannot use the internet to download extra software in the future. You can either buy the discs or download them for free from the Debian website.
Installation from a network or the internet.
You can install directly from the internet. You need a "netinst" version of the installation CD (from the Debian website) and a connection to the internet via your computer's "network" socket. This could mean that your computer is connected either to a network or to a DSL/ADSL broadband modem/router with an RJ45 network cable.

2 What you need

2.1 Hardware and media

These are the items you will need in order to install Debian.

  • a computer with
    • a bootable CD/DVD drive and
    • EITHER a hard drive that is empty or that you do not mind erasing completely
    • OR a hard drive that has enough free space for adding Debian, or an additional hard drive for Debian;
  • one of the official Debian installation media:
    • first disc of CD or DVD set or
    • netinst CD

2.2 Information you supply to the installer

The installer will ask you to supply this information. You can choose some of it from lists provided by the installer.

2.2.1 Installation from CD/DVD

  • Language used during installation (chosen from a list).
  • Country in which the computer will be used (chosen from a list).
  • Keyboard layout of the computer's keyboard (chosen from a list).
  • Hostname used to identify the computer (made up by you).
  • Password for the administrative superuser "root" (made up by you).
  • User name of someone who will use the computer for normal (non-administrative) purposes. (This will normally be your name).
  • Username, or nickname, to be used by the computer to recognise the normal user. (This could be your firstname.)
  • A different password for the normal user (made up by you).

2.2.2 Installation from Network

The installer will want all the information needed when installing from CD/DVD and these additional items.

  • Domain name of the network to which computer belongs (supplied by the network administrator or made up by you for a home network or modem/router).
  • Debian archive mirror server used to supplement the software on the CD/DVD. This is often something like ftp.<your country code>.debian.org (chosen from a list).

3 Outline of installation

  1. Boot from the installation CD/DVD.
  2. Choose a language.
  3. Choose a country.
  4. Choose a keyboard layout.
  5. Set the computer's hostname.
  6. Set the network domain name (only if connected to a network).
  7. Partition the hard drive.
    1. Choose the partitioning method - whether to erase the hard drive or shrink an existing partition (eg a Windows partition); whether to use the entire hard drive or just part of it.
    2. Choose the partitioning scheme - whether to put all files in one partition or to use additional partitions for different parts of the filesystem.
  8. Set up users and passwords.
  9. Choose a Debian archive mirror server (only if connected to a network).
  10. Configure the popularity contest - a survey to measure the most frequently used Debian software.
  11. Install optional software collections eg a desktop environment.
  12. Install the Grub bootloader.
  13. Reboot the computer.

4 Installation in detail

4.1 Boot from the install CD/DVD

Switch on the computer and immediately insert the installation CDROM or DVD. If you are using a disc set, insert the first disc. If you are installing from the internet via a network connection, insert the "netinst" CD. If you take too long the computer will not boot from the CD/DVD but will boot normally from the hard drive. Just reboot (restart) the computer with the CD/DVD still in the drive. If the computer still does not boot from the installation CD/DVD, check your BIOS settings. The Appendix gives instructions for this.

You will see the installer's boot screen with a message and a flashing cursor at the bottom.

Press F1 for help, or ENTER to boot:


The installer boot screen has a flashing cursor.

Fig 1: The installer boot screen has a flashing cursor.

A GUI is a Graphical User Interface which enables you to use a mouse. The GUI version of the Debian installer will not become the default until Debian Lenny is released. However, you can opt to run the GUI installer by entering "installgui" at the flashing prompt.

installgui

The computer will boot into the GUI version of the installer.

4.2 How to use the installer

The installer's screens have buttons to enable you to move forwards and backwards through the installation process. You can provide information by choosing from lists, ticking boxes and entering text into boxes. On some screens there are progess bars to show you how far the installer has got.

You can interact with the installer's screens using the mouse in the normal way. Alternatively, you can use the arrow, tab, spacebar, Esc and Enter keys. The table shows how you can do this.

Mouse command Keyboard command
Continue Click "Continue" or double-click on item Press "Enter" key
Go Back Click "Go Back" Press "Esc" key
Select list item Click item Press "Up-arrow" or "Down-arrow" key
Select other items Click item Cycle selection with "Tab" key
Tick items Click tick box Select item and press "Tab", then "Spacebar" then "Tab"
Radio choice items Click radio button Select item and press "Spacebar"
Enter text Select text box and type text Select text box and type text


4.3 You choose a language

The first screen asks you to choose the language to be used for the rest of the installation.

The installer GUI screen for choosing language.

Fig 2: The installer GUI screen for choosing language.

Select a language (eg "English") from the list and click on the "Continue" button (or press the "Enter" key). Alternatively, you can double-click on "English".

English

Continue

4.4 You choose a country

If the installer knows about your location (country, territory or area), it can make guesses about other configuration options. Select country (eg "United Kingdom") from the list and continue to the next screen.

United Kingdom

Continue

4.5 You choose a keyboard layout

There is a list of keymaps. A keymap is a map of the position of every key on the computer's keyboard. Select a keymap (eg "British English") from the list and continue to the next screen.

British English

Continue

4.6 The installer fetches files from the CDROM

The installer finds the CDROM, then detects and mounts it. It then gets the files it needs from the CDROM. You can follow the installer's progress on the screens with coloured bars.

Detecting hardware to find CD-ROM drives
Scanning CD-ROM
Loading additional components 

The coloured progress bar progress

Fig 3: The coloured bar shows progress.

4.7 The installer configures the network

The installer can use a network connection to fetch the latest security updates. It can also use the network connection as an alternative installation source instead of CD/DVD.

Most modern computers have a network card. The installer checks to see if you have one. If your network card is connected to a DSL/ADSL broadband modem, or if it is part of another network, the installer tries to connect to it. It does this by looking for a "DHCP" server on the network and asking it for a connection.

The coloured bars show progress.

Detecting network hardware
Configuring the network with DHCP

If your computer is not connected to a network, automatic network detection will fail.

Network autoconfiguration failed

Continue

This does not matter - just leave the network unconfigured. It just means that the installer will not fetch any security updates during installation. You can always fetch them later (eg by reconfiguring the repositories list using the "Synaptic" program).

Do not configure the network at this time

Continue

4.8 You set the computer's hostname

The hostname[1] is the name that identifies the computer . It will be used in a variety of situations including the commandline prompt, logs, messages, and network connections. You must set a hostname even if the computer is not connected to a network at the moment. The default hostname is "debian", but you can change it to something else. For instance, to change it to "mybox", enter "mybox" into the "Hostname" text box.

Hostname: mybox

Continue


4.9 You set the network domain

You only need to do this if your computer is connected to a network. Otherwise the installer will go straight to partitioning your hard drive (described in the next section).

You must tell the installer about the domain name (the segment of the network to which the computer will belong). If you are setting up a simple home network, you can make something up eg "myhome". All the computers in a simple network must have the same domain name.

Domain name: myhome

Continue

The installer detects and identifies your hard drives and other hardware needed for sound, printing, etc. The coloured bar shows progress.

Detecting disks

4.10 You partition the hard drive

You can follow the coloured progress bar as the installer sets up the partitioning software.

Starting up the partitioner

4.10.1 You choose the partitioning method

You have a choice between guided and manual partitioning. For a simple installation choose one of the guided methods.

4.10.1.1 Simple installation - erase everything on the hard drive

If your hard drive is empty, or you do not mind erasing it completely, choose the "Guided" method that will guide you through using the whole disc:

Guided - use entire disk

Continue
 
Warning
Warning: 
This method will erase the entire disc. You will lose anything that is already on the hard drive that you choose.
 

If you have only one disc, the installer will show only one entry in the list of discs to partition eg "IDE1 master(hda)":

IDE1 master(hda) - 8.4GB SOME MANUFACTURER HARDDISK

Continue

If you have more than one disc, the installer will ask you which one to partition. If you wish to install Debian on a second hard drive, choose that disc. It will be "IDE2 master(hdb)" or something similar.

Go straight on to choosing the partitioning scheme.

4.10.1.2 Dual-boot installation - shrink an existing partition

If have only one hard drive and you wish to keep an existing operating system, you must make room for a Debian partition on the hard drive. Choose the "Manual" method.

Manual

Continue

Select the partition containing the existing operating system. It will probably be the first ("#1")primary partition on the first master disc ("hda"). In this example of a typical Windows system, the partition size is 8.4 GB, it is bootable ("B") and is formatted with the "ntfs" file system.

>   #1 primary  8.4 GB B ntfs

Continue

Now you can resize the existing partition to free up some space for Debian partitions.

 
Warning
Warning: 
Make sure that you have backed up any important files before continuing.
 
Resize the partition (currently 8.4 GB)

Continue

Write previous changes to disk and continue?
Yes

Continue

The amount that you can shrink the partition depends on how much free space there is inside the partition. For example, if the existing partition has something over 50% free space inside it, you could shrink the partition by 50%. In practice, you should plan to end up with adequate free space inside the existing partition after it has been resized.

New partition size:
50%

Continue

You can follow progress with coloured bar. It may take a while.

Please wait...

Eventually, you will see the new partition table including the free space.

IDE1 master (hda) - 8.4 GB SOME_MANUFACTURER HARDDISK
  > # 1 primary  4.2 GB B ntfs
  >   pri/log    4.2 GB   FREE SPACE

Now you must partition the FREE SPACE for Debian. Select the FREE SPACE.

  >   pri/log  4.2 GB   FREE SPACE

Continue

Now you must choose how to partition this free space. Choose the partitioning scheme in the next section.

4.10.2 You choose the partitioning scheme

Select the simplest scheme which installs all the files into one partition.

All files in one partition - (recommended for new users)

Continue

You can follow the coloured progress bar as the installer works out how best to fit the partition onto the hard drive.

4.10.3 You check the proposed partition information

The partitioner will propose setting up a "primary" partition for all files and and a "logical partition for swap. (Swap is temporary storage and improves you computer's performance.)

The hard drive will be identified by "hda", "sda" or something similar.

IDE1 master (hda) - 8.4GB SOME_MANUFACTURER HARDDISK

If you are doing a simple installation and overwriting the whole disc, you will see one primary partition. It will be partition number 1 formatted with the "ext3" filesystem and a mountpoint of "/" ("root of filesystem")

>   #1 primary   8.3 GB B f ext3    /

If you are doing a dual boot installation you will see two partions -one containing your original operating system and a new one for the Debian root filesystem.

>   #1 primary  4.2 GB     ntfs
>   #2 primary  4.1 GB B f ext3    /

There will be another small "logical" partition for the swap space. Partition number 5 is the first available logical partition. It will be formatted for use as swap.

>   #5 logical  156 MB   f swap    swap

Select the option to finish partitioning, and continue.

Finish partitioning and write changes to disk

Continue

The installer will warn you that you are about to erase your hard drive.

WARNING: This will destroy all data on any partitions ... that are going to be formatted.
[...]
Write the changes to disks?

Select "Yes", and continue.

Yes

Continue

4.10.4 The installer partitions the hard drive

The installer creates the new partitions, formats them and sets the clock. The coloured bars show progress.

Partitions formatting
Setting up the clock

4.11 You set up users and passwords

Your new Debian system must have an all-powerful superuser called "root". You must enter a password for user root.

Root password: ******

Re-enter password to verify: ******
Continue

Continue to the next screen. You should normally login to your new system only as a normal user. You must set up a normal user and password now. You can add more users when the installation is complete.

Full name for the new user: Firstname Surname

Continue

Continue to the next screen to set the username for the account. This name will be used to login, regulate access to certain files and to define a user area for storing personal work and configuration files called a "home directory".

Username for your account: nickname

Continue

Continue to the next screen to set a password for your new normal user.

Choose a password for the new user: ******
 
Re-enter password to verify: ******

Continue

4.12 The installer installs the base system

The installer fetches and installs files need for the base Debian system from the CD. The coloured bar shows progress. It may take a few minutes.

Installing the base system

4.13 The installer configures the package manager

Debian's Advanced Package Tool (APT) is a system that makes finding and installing software very easy. The installer configures APT with the settings you need. The coloured bar shows progress.

Configuring Apt

The installer may ask you whether you wish to use a network mirror server for supplementary software. It is wise to answer "yes" if you are connected to a network. You can answer "No" if you are installing software only from CD/DVD.

Use a network mirror?
Yes or No (see text)

Continue

Choose a repository from the list. If you live in the UK, you might choose the following archive mirror server:

United Kingdom

Continue

ftp.uk.debian.org

Continue 

You can also configure an HTTP proxy if you use one. If you don't have one, or don't know what this means, leave the HTTP proxy entry blank and continue.

Configuring Apt

The installer tries to access security updates from a repository on the Debian website. This will fail if you are not yet connected to the internet. If you get a failure message, just continue to the next screen. You can enable security updates after installation (eg using the "Synaptic" program for installing software).

Cannot access security updates

Continue

4.14 The installer selects and installs software

The installer fetches and installs some of the files needed for the core of a Debian system. The coloured bar shows progress.

Select and install software

4.15 You configure the popularity contest

The popularity contest is software that sends statistics to Debian software developers about the software you use most frequently. Popularity contest needs a network connection. If you do not want to participate at the moment, choose "No" and continue. If you change your mind later, you can reconfigure "popularity-contest" with the "Synaptic" program.

No

Continue

4.16 The installer selects and installs more software

The installer fetches and installs more of the files needed for the core of a Debian system. The coloured bar shows progress.

Select and install software

4.17 You choose some software collections to install

You will need more than just the core of the Debian system. For a desktop system (including mouse, menus, taskbar, etc), tick the boxes for Standard system and Desktop environment.

Standard system
Desktop environment

If you are installing on a laptop, also tick the box for Laptop.

Laptop

Then continue. You can watch progress with the coloured bar as the installer selects and installs the software.

Continue

Select and install software

4.18 You install the Grub bootloader

The bootloader is a little program used by the computer's BIOS to boot your new Debian system.

Installing GRUB boot loader

You normally install the bootloader to the MBR (Master Boot Record). The MBR is a small sector at the beginning of your first hard disc.

Install the GRUB boot loader to the master boot record? 
Yes

Continue

The coloured bar shows progress.

Install the GRUB boot loader on a hard disk

4.19 You finish the installation

When the installation is finished, the CDROM is ejected. You can remove the CD and reboot the computer.

Installation complete

Continue

Your computer will now boot into the wonderful world of Debian.

5 Comments

If you find any mistakes or you have any ather comments, please add them to this article's discussion page

6 Appendix A: Configure the computer BIOS to boot from CD

Modern computers can boot directly from CDROM, but this feature may not be enabled on your computer. You must check that your BIOS is set to enable booting from CDROM. The BIOS starts you computer and connects it to the keyboard and screen. Then it looks for an operating system, such as Linux or Windows, to start the boot process. You must set CDROM as the "first boot device" so that the BIOS will look for a CDROM before it looks for a hard disc.

Make sure that your computer is switched off. Switch on the computer. Look at the text messages on the screen and find the BIOS "setup" key. In modern computers this is normally the "Del" key. The initial screen message may look something like this:

Press DEL to run Setup

You will only have a few seconds to press the setup key. If you miss it you may have to switch off and try again.

Navigate the BIOS setup menus with the arrow keys. Look for a menu involving the "boot" process. Change the boot device priority so that the CDROM appears as the first device. You should have something like this:

1st Boot Device	[CDROM]
2nd Boot Device	[Hard Drive]

Save the changes and exit setup. In many BIOSs you can do this by pressing the F10 key. Look for help at the margins of the menu screen.


7 Appendix B: Licence

Copyright (c) 2007 Chris Lale. chrislale AT users DOT berlios DOT de

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license can be found at http://www.fsf.org/copyleft/fdl.html.

Content is available under GNU Free Documentation License 1.2, unless otherwise stated.