Tux by Larry EwingTux by Larry Ewing

Installing Debian Etch

partitions base security users sudo commands halt hints etc

I created this condensed install manual to document the way that I install Debian 4.0 (etch) GNU/Linux on x86 hardware, and to consolidate some tidbits of knowledge that I've learned. You may want to read the official Debian Installation Manual for more details. I always recommend installation onto a dedicated computer. The network install method used throughout requires an internet connection through an ethernet card or wireless card. Good luck, take it slow, and have fun.   –Brett Hamilton

Getting Started

debian cd In your BIOS, set the hardware clock to UTC
and set the first boot device for your boot media:

USB-ZIP: boot from a USB flash drive
CDROM:   boot the debian netinst CD
FLOPPY:  boot the debian CD using the SBM floppy
FLOPPY:  boot from the debian floppies

boot: <enter>
language = English
region = United States
keymap = American English
pick a good hostname
use your domain name

At the “Choose a Mirror” screen, activate a virtual console:

left Alt+F2  <enter>   

Test and Wipe the Disk

This example is of a computer with a single, empty IDE hard disk. When I am installing on a new disk, or an old disk that may be defective, or a disk with data that I no longer need, I run a destructive, read-write badblocks test on the entire disk at this point. It's quicker and more thorough than testing each partition separately. Right before running badblocks, I use fdisk to list the partitions in order to double check that this is indeed the disk I want to erase. You can run badblocks from a KNOPPIX CD, which is a great tool to have on hand (and requires less typing). Or you can download the fdisk and badblocks programs with wget:

# wget http://linux.simple.be/jump/etch/fdisk.bin
# wget http://linux.simple.be/jump/etch/badblocks.bin
# chmod 755 fdisk.bin
# chmod 755 badblocks.bin
# ./fdisk.bin -l /dev/hda

Warning, this next command will irreversibly destroy all data on the disk:

# ./badblocks.bin -o bb -w -s -v /dev/hda

Depending on the size and speed of your disk, this badblocks test may take many hours, but it is worth the wait. I do not use a disk if it has any badblocks, as this can be a sign of deteriorating disk surface contitions. One bad block can lead to more bad blocks, and data may become totally corrupted or lost.

left Alt+F1 to get back to the installer menu

Download the installer files from a mirror

location =   Unites States
mirror   =   ftp.us.debian.org
proxy    =   blank

Partition the Disk

Note: If you want to install Microsoft Windows and Debian Linux on the same hard disk (I don't recommend this), create the Windows partition first with Window's fdisk, leaving unallocated disk space for Linux. Then create the Linux partitions with a Linux partitioner (like fdisk or cfdisk). There are too many different partition configurations to cover them all here, so make sure you understand what you are doing. Read the chapter on Partitioning for Debian, and read other documentation on dual-booting. If mounting a Windows partition in Linux, I recommend read-only mode.

Partitioning method: Erase entire disk  (probably hda or sda)
All files in one partition
select partiton #5
delete the partition
select free space
create new partition (accept default size)
Partition Type: primary
Use as swap area
done setting up the partition

Finish partitioning and write changes to disk
Write changes to disk? <Yes>

The debian installer will now format your new ext3 filesytem.

Installing the Base System

TimeZone            = Pacific       (use your local time zone)
root password       = *******      (pick a strong password)
create user account = Firstname Lastname
create user account = user
user's password     = *******      (use a different strong password)

The debian installer will now download and install bunch of packages for your base system.

Paricipate in the package usage survey? <Whataver>

Software Package Selection

The goal here is to create a stable system with the highest probability of working.
Once the system is up and running, adding more packages is very easy.

For software selection, leave only the Standard System box checked.
Hit <Spacebar> to unselect the Desktop Environment box.
Hit Tab then Enter to <Continue>

Wait while a bunch more packages get installed.

Install GRUB in the master boot record? <Yes>
At the installation complete message,
remove the media that you booted from (USB or CD-ROM)
Then hit <Continue> and the system will reboot.

Moment of Truth

Power on. Boot Linux.   (look at all those nifty bootup messages)
Login: root
Password: *******      (the root password)
If you get a command prompt, hostname:~# 

Well Done, You!

Congratulations, you now have a bootable, functioning Linux system! If you are a Unix/Linux novice, you may want to get yourself familiar with Linux at this point. Running Linux is a good book.

Where I have typed user, replace that with your username.
Where I have typed emacs, you can replace that with your favorite text editor.

Lines that begin with # are commands to be run as root
Lines that begin with ] are commands to be run as user

From this point forward, you can do whatever you want,
but now is a good time to install your favorite shell, and other tools.

# aptitude install zsh              (my favorite shell)
# aptitude install pciutils         (PCI utilities) 
# aptitude install smartmontools    (SMART hard disk utilities)
# aptitude install bzip2            (bzip tools)
# aptitude install lynx             (a simple text-based web broswer) 
# aptitude install ssh              (The SSH server) 
# aptitude install emacs21-nox      (the emacs text editor)
# aptitude install jove             (the jove text editor)
# aptitude install ntp-simple       (keeps your clock on time)
# aptitude install rsync
# aptitude install imagemagick
# aptitude install unzip
# aptitude install jhead jpeginfo
# aptitude install libterm-readkey-perl libcurses-perl

Text Editor

You will need a text-editor. nano is installed by default, and it is really easy to use.

I currently prefer emacs because it is very powerful.

The Man

You should make yourself familiar with the UNIX "manual pages".
These are built-in documentation manuals for almost all commands and programs.
For example, to see the man page for the ls command, type:

] man ls

Other helpful man pages:

] man man
] man wget
] man ping


Before going any further, you need to be aware of security. Linux is a real multi-user OS and it is important that you secure your system against unauthorized access. If a Linux box is on a network, and bad people get into it, they can run programs and do nasty things without having any physical access to the hardware.

gpg lock Passwords:

Network Security:

Keep Up To Date:


In UNIX (and Linux), there are some things you must do as root.
For everything else, use your regular user account.

Login: user
Password: ****** (your regular user password)

Whenever you want to logout:

] logout
] exit

You can create user accounts for your family and friends:

# adduser newusername


If you want to change your shell from bash to zsh, find zsh's path with which

] which zsh

then run "change shell" with the correct path to your new shell:

] chsh -s /usr/bin/zsh

Hit Alt+F2 and login again. You're now running zsh.


With sudo, you can run commands as root without logging-in as root. Sudo is nice because, while doing necessary tasks as root, you still have your familiar shell, aliases and environment. This seems to reduce mistakes and typos.

Install sudo:

# aptitude install sudo

Configure sudo:

# emacs /etc/sudoers
    add a line:
    user  ALL=(ALL) ALL

To run one command as root:

] sudo command 

For more commands, run your shell with sudo.

] sudo zsh      (if zsh is your shell.)

Be careful when you are root. When you are done, type exit

Nifty commands

] lspci
] lsmod
] ifconfig
] cat /proc/cpuinfo
] cat /proc/interrupts
# updatedb
] locate file
] df
] lsmod
] free
] uptime
] uname -a


To turn your computer off, run:

# halt

To reboot your computer, run:

# reboot

Debian Hints

Note: This section may be out of date as of the new etch release.
These often-used commands are for manipulating the debian packages and system files.
Replace pkg with the exact name of the package.

# apt-get update          update the package lists
# dselect update          update the available package lists
# apt-get upgrade         upgrade all installed packages
# apt-get install pkg     installs package
# apt-get remove pkg      uninstall package

] dpkg -l                 show all installed and removed packages
] dpkg -l pkg             show install status of package
] dpkg -l "*pattern*"     show all packages that match pattern
] dpkg -S pattern         list packages that contain string
] dpkg -L pkg             list files in package
] dpkg -s pkg             show status of package
] dpkg -p pkg             show details of package
] apt-cache search string list relevant packages

# dpkg -i file.deb        install package from a deb file
# dpkg -P pkg             purge package (and config?)
# dpkg-reconfigure pkg    re-run the configure for a package
# apt-get source pkg      get the source
# apt-get build-dep       config build-deps for source and install as needed
# apt-get -t release install pkg    install package from specific release
# update-rc.d -f name remove    prevent name from running at bootup

Remote display of X applications

The coolest aspect of X is its client-server design, which allows the remote display of applications over a network. For example: You you can run an X-server on an old (slow) laptop, and then run an X-client (application) on a different (fast) computer. The application is displayed on the laptop's screen, and you interact with the application with your laptop's mouse, and keyboard. The application runs fast while using very little of the old laptop's RAM and CPU. Additionally, an X-server is not needed on the computer that sends X-client displays to other computers. The terms “server” and “client” may seem backwards here, but they are correct. One X-server can accept connections from multiple X-clients.

On the X-client side:

From the X-server side:

Install more X applications

# aptitude install xearth
# aptitude install gimageview           

Further Documentation

Enjoy Debian

I hope this manual gets you on your way to using Debian. Etch was recently released, so I'll be updating this page in the coming weeks. Let me know if you have any comments or suggestions.

top of page.

simple.be linux   simple holster   created on debian gnu/linux      last updated: 2009-03-20   contact    XHTML CSS