Installing Debian Etch from the Net


Here's a quick guide on how to install Debian 4.0, a.k.a. "Etch" from the 150MB NetInst CD and fetch the rest of the files from the Net.


  1. Burn the ISO image, boot with it and follow the install procedure
  2. Once the OS is installed, run "apt-get update ; apt-get upgrade"



Debian will use the same language that you chose during the install. If you want to switch to English US after Debian is up and running:

  1. Check the current language + locale: env | grep LANG
  2. dpkg-reconfigure locales
  3. export LANG=en_US.UTF-8

CHECK How to make it sticky between reboots?

Turn off CAPSLOCK key

xmodmap -e "remove lock = Caps_Lock"

xmodmap:  unable to open display ''


setxkbmap -option ctrl:nocaps

Cannot open display "default display"


Packages to remove

  1. /etc/init.d/rpcbind stop ; apt-get purge rpcbind
  2. /etc/init.d/exim4 stop ; apt-get purge exim4

CHECK uninstalling packages leaves scripts and symlinks under /etc/init.d/ and /etc/rc3.d/


Vi might display "A,B,C,D" when using arrow keys when connecting remotely through SSH: apt-get install vim


  1. vi /etc/profil
  2. alias ll='ls -alF --color'

Midnight Commander

apt-get install mc

CHECK How to correct keyboard shortcuts?


apt-get install ntpdate

ntpdate (instant time sync)

apt-get install ntp (ntpd provides gradual, regular time sync)

vi /etc/ntp.conf, and add servers close to you, eg. for France:





/etc/init.d/ntp restart


If you chose to install the basic configuration, SSHd should not be installed : apt-get install ssh. Once it's up and running, you can connect to the server from a remote host if you need to.

By default, you must log on as a non-root user before "su -" to root

Display man pages correctly

If some words aren't displayed in man pages, make sure you set the SSH client application to use black bold text on white background.

Schedule host to go to sleep and wake up


  1. Check that rtcwake is available: which rtcwake
  2. Next, check if the BIOS set the time in UTC or local time: timedatectl
  3. Finally, check what suspend modes the hardware supports: cat /sys/power/state

For testing purposes, here's how to tell rtcwake to not go into suspend mode, wake up in 1mn, and put the computer in suspend mode manually:

Note that rtcwake above displays the time in UTC, not local time.

Here's how to tell rtcwake to wake up tomorrow at 11:45AM:

To cancel a task, use rtcwake -m disable

Note: rtcwake only runs once. If you need to schedule a cycle of wakeup/suspend every day such as to back up files, add calls in cron:

  1. crontab -e
  2. #Wake up at 11:45AM and go back to sleep at 1:00PM
    0 13 * * * /usr/sbin/rtcwake -m disk -u -t $(date +\%s -d 'tomorrow 1145')


The server did detect the USB pen drive, but didn't auto-mount it. To do this, edit /etc/fstab, and add the following, using TABs in between columns:

/dev/sda1    /mnt/pen    vfat    noauto,users    0    0


apt-get install samba

update /etc/samba/smb.conf

/etc/init.d/samba start


CTRL-Z to cancel?

  1. ll : uncomment /root/.bashrc
  2. No mouse
  3. USB KVM
  4. Beep : editing /etc/inputrc to uncomment those two lines stops the beep in bash when using the backspace key while in column 1, but doesn't stop vi/vim from being when using either the left arrow while in column 1 or hitting the ESC key:

    set bell-style none
    set bell-style visible
  5. Bad backspace key in vim: edit /etc/profile, and add the following:

    stty erase ^H
    alias ll='ls -al --color=auto'

  6. While in vi, arrow keys show ABCD : use vim
  7. Grub : no keyboard

User-friendly text editor





vi /etc/apt/sources.list

#deb cdrom:[Debian GNU/Linux 4.0 r0 _Etch_ - Official i386 NETINST Binary-1 20070407-11:29]/ etch contrib main

apt-get update

dpkg -l php*

dpkg -l apache* | grep ^i

dpkg -L php5-mysql

dpkg -S php.ini


apt-get install apache2

Why need to edit /etc/apache2/sites-available/default to remove RedirectMatch ^/$ /apache2-default/?

debian:/etc/apache2# pwd


debian:/etc/apache2# ll

total 60

drwxr-xr-x  7 root root  4096 2007-07-16 22:08 .

drwxr-xr-x 59 root root  4096 2007-07-16 23:25 ..

-rw-r--r--  1 root root 24175 2007-03-27 14:53 apache2.conf

drwxr-xr-x  2 root root  4096 2007-07-16 22:08 conf.d

-rw-r--r--  1 root root   895 2007-03-27 14:58 envvars

-rw-r--r--  1 root root     0 2007-07-16 22:08 httpd.conf

drwxr-xr-x  2 root root  4096 2007-07-16 23:25 mods-available

drwxr-xr-x  2 root root  4096 2007-07-16 23:25 mods-enabled

-rw-r--r--  1 root root    10 2007-07-16 22:08 ports.conf

drwxr-xr-x  2 root root  4096 2007-07-16 23:26 sites-available

drwxr-xr-x  2 root root  4096 2007-07-16 22:08 sites-enabled


apt-get install php5


vi /etc/php5/apache2/php.ini


apt-get install mysql-server
apt-get install php5-mysql
apt-get install phpmyadmin php5-mcrypt php4-mcrypt php5-gd php4-gd
# mysql -u root
mysql> use mysql;
mysql> update user set password=password('test') where user='root';
mysql> flush privileges;
mysql> exit;
# mysql -u root -p
mysql> exit;


apt-get install postfix postfix-mysql postfix-pgsql postfix-ldap postfix-pcre sasl2-bin libsasl2-modules resolvconf postfix-cdb


/etc/init.d/postfix reload

debian:/etc/apache2# ll /var/spool/postfix/

total 76

drwxr-xr-x 19 root    root     4096 2007-07-16 23:54 .

drwxr-xr-x  4 root    root     4096 2007-07-16 23:55 ..

drwx------  2 postfix root     4096 2007-07-16 23:50 active

drwx------  2 postfix root     4096 2007-07-16 23:50 bounce

drwx------  2 postfix root     4096 2007-07-16 23:50 corrupt

drwx------  2 postfix root     4096 2007-07-16 23:50 defer

drwx------  2 postfix root     4096 2007-07-16 23:50 deferred

drwxr-xr-x  2 root    root     4096 2007-07-16 23:54 etc

drwx------  2 postfix root     4096 2007-07-16 23:50 flush

drwx------  2 postfix root     4096 2007-07-16 23:50 hold

drwx------  2 postfix root     4096 2007-07-16 23:50 incoming

drwxr-xr-x  2 root    root     4096 2007-07-16 23:54 lib

drwx-wx--T  2 postfix postdrop 4096 2007-07-16 23:50 maildrop

drwxr-xr-x  2 postfix root     4096 2007-07-16 23:50 pid

drwx------  2 postfix root     4096 2007-07-16 23:54 private

drwx--s---  2 postfix postdrop 4096 2007-07-16 23:54 public

drwx------  2 postfix root     4096 2007-07-16 23:50 saved

drwx------  2 postfix root     4096 2007-07-16 23:50 trace

drwxr-xr-x  3 root    root     4096 2007-07-16 23:50 usr


debian:/etc/apache2# postfix set-permissions

chown: cannot access `/usr/lib/postfix/': No such file or directory

debian:/etc/apache2# apt-get -s install postfix-sdbm

E: Couldn't find package postfix-sdbm


DEL doesn't work in Nano : deletes previous character instead of following character -> edit /etc/nanorc, and add this "set rebinddelete"

Doesn't support FR keyboard: "un probl�me de connexion"

Doesn't go to end of line when hitting End key


Ubuntu 7.04 doesn't like my network cards

Tried a RealTek, then a DLink, same error:

eth0: ERROR while getting interface flags: No such device
There is already a pid file /var/run/ with pid 134993416
Internet Systems Consortium DHCP Client V3.0.4
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
eth0: ERROR while getting interface flags: No such device
Bind socket to interface: No such device
Failed to bring up eth0.

How to search package repositories for a package?

PunBB, etc.

# less /etc/dpkg/origins/debian

Vendor: Debian


Bugs: debbugs://

Dpkg vs. dselect vs. apt-get

dpkg  is  a  tool  to install, build, remove and manage Debian packages. The primary and more user-friendly front-end for dpkg is dselect. dpkg can be also be used as a front-end to dpkg-deb.

apt-get is the command-line tool for handling packages, and may be considered the user's "back-end" to other tools using the APT library. Several "front-end" interfaces exist, such as dselect), aptitude, synaptic, gnome-apt and wajig.

apt-get update vs. upgrade

"update" is used to resynchronize the package index files from their sources. The indexes of available packages are fetched from the location(s) specified in /etc/apt/sources.list. "upgrade" is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list.

Windows-like text editor

SetEdit : OK

MCEdit : OK

ne : OK (F1 for menu)

Jed : OK


Le Editor : only old version in Debian repository

Managing packages

To search repositories for new software to install:

apt-get update ; apt-get search

apt-cache search "*emacs" = BAD???