1
<!-- retain these comments for translator revision tracking -->
2
<!-- original version: 18773 untranslated -->
4
<sect1 id="linux-upgrade">
5
<title>Installing &debian; from a Unix/Linux System</title>
9
This section explains how to install &debian; from an existing
10
Unix or Linux system, without using the ncurses-based, menu-driven
11
installer as explained in the rest of the manual. This "cross-install"
12
HOWTO has been requested by users switching to &debian; from
13
Redhat, Mandrake, and SUSE. In this section some familiarity with
14
entering *nix commands and navigating the file system is assumed. In
15
this section, <prompt>$</prompt> symbolizes a command to be entered in
16
the user's current system, while <prompt>#</prompt> refers to a
17
command entered in the Debian chroot.
21
Once you've got the new Debian system configured to your preference,
22
you can migrate your existing user data (if any) to it, and keep on
23
rolling. This is therefore a "zero downtime" &debian;
24
install. It's also a clever way for dealing with hardware that
25
otherwise doesn't play friendly with various boot or installation
31
<title>Getting Started</title>
34
With your current *nix partitioning tools, repartition the hard
35
drive as needed, creating at least one filesystem plus swap. You
36
need at least 150MB of space available for a console only install,
37
or at least 300MB if you plan to install X.
41
To create file systems on your partitions. For example, to create an
42
ext3 file system on partition <filename>/dev/hda6</filename> (that's
43
our example root partition):
45
<informalexample><screen>
49
</screen></informalexample>
51
To create an ext2 file system instead, omit <userinput>-j</userinput>.
55
Initialize and activate swap (substitute the partition number for
56
your intended Debian swap partition):
58
<informalexample><screen>
64
</screen></informalexample>
68
Mount one partition as <filename>/mnt/debinst</filename> (the
69
installation point, to be the root (<filename>/</filename>) filesystem
70
on your new system). The mount point name is strictly arbitrary, it is
71
referenced later below.
73
<informalexample><screen>
76
$ mount /dev/hda6 /mnt/debinst
78
</screen></informalexample>
84
<title>Install <command>debootstrap</command></title>
87
The tool that the Debian installer uses, which is recognized as the
88
official way to install a Debian base system, is
89
<command>debootstrap</command>. It uses <command>wget</command>, but
90
otherwise depends only on <classname>/bin/sh</classname>. Install
91
<command>wget</command> if it isn't already on your current system,
92
then download and install <command>debootstrap</command>.
96
If you have an rpm-based system, you can use alien to convert the
97
.deb into .rpm, or download an rpm-ized version at
98
<ulink url="http://people.debian.org/~blade/install/debootstrap"></ulink>
102
Or, you can use the following procedure to install it
103
manually. Make a work folder for extracting the .deb into:
105
<informalexample><screen>
110
</screen></informalexample>
113
The <command>debootstrap</command> binary is located in the Debian
114
archive (be sure to select the proper file for your
115
architecture). Download the <command>debootstrap</command> .deb from
116
the <ulink url="http://ftp.debian.org/debian/pool/main/d/debootstrap/">
117
pool</ulink>, copy the package to the work folder, and extract the
118
binary files from it. You will need to have root privileges to install
121
<informalexample><screen>
123
$ ar -xf debootstrap_0.X.X_arch.deb
125
$ zcat < /full-path-to-work/work/data.tar.gz | tar xv
127
</screen></informalexample>
133
<title>Run <command>debootstrap</command></title>
136
<command>debootstrap</command> can download the needed files directly
137
from the archive when you run it. You can substitute any Debian
138
archive mirror for <userinput>http.us.debian.org/debian</userinput> in
139
the command example below, preferably a mirror close to you
140
network-wise. Mirrors are listed at
141
<ulink url="http://www.debian.org/misc/README.mirrors"></ulink>.
145
If you have a &releasename; &debian; CD mounted at
146
<filename>/cdrom</filename>, you could substitute a file URL instead
147
of the http URL: <userinput>file:/cdrom/debian/</userinput>
151
Substitute one of the following for <replaceable>ARCH</replaceable>
152
in the <command>debootstrap</command> command:
154
<userinput>alpha</userinput>,
155
<userinput>arm</userinput>,
156
<userinput>hppa</userinput>,
157
<userinput>i386</userinput>,
158
<userinput>ia64</userinput>,
159
<userinput>m68k</userinput>,
160
<userinput>mips</userinput>,
161
<userinput>mipsel</userinput>,
162
<userinput>powerpc</userinput>,
163
<userinput>s390</userinput>, or
164
<userinput>sparc</userinput>.
166
<informalexample><screen>
168
$ /usr/sbin/debootstrap --arch ARCH sarge \
169
/mnt/debinst http://http.us.debian.org/debian
171
</screen></informalexample>
178
<title>Configure The Base System</title>
182
Now you've got a real Debian system, though rather lean, on disk.
183
<command>Chroot</command> into it:
185
<informalexample><screen>
187
$ chroot /mnt/debinst /bin/bash
189
</screen></informalexample>
193
<title>Mount Partitions</title>
196
You need to create <filename>/etc/fstab</filename>.
198
<informalexample><screen>
202
</screen></informalexample>
206
Here is a sample you can modify to suit:
208
<informalexample><screen>
210
# /etc/fstab: static file system information.
212
# file system mount point type options dump pass
213
/dev/XXX / ext2 defaults 0 0
214
/dev/XXX /boot ext2 ro,nosuid,nodev 0 2
216
/dev/XXX none swap sw 0 0
217
proc /proc proc defaults 0 0
219
/dev/fd0 /mnt/floppy auto noauto,rw,sync,user,exec 0 0
220
/dev/cdrom /mnt/cdrom iso9660 noauto,ro,user,exec 0 0
222
/dev/XXX /tmp ext2 rw,nosuid,nodev 0 2
223
/dev/XXX /var ext2 rw,nosuid,nodev 0 2
224
/dev/XXX /usr ext2 rw,nodev 0 2
225
/dev/XXX /home ext2 rw,nosuid,nodev 0 2
227
</screen></informalexample>
231
Use <userinput>mount -a</userinput> to mount all the file systems you
232
have specified in your <filename>/etc/fstab</filename>, or to mount
233
file systems individually use:
235
<informalexample><screen>
237
# mount /path # e.g.: mount /usr
239
</screen></informalexample>
243
You can mount the proc file system multiple times and to arbitrary
244
locations, though /proc is customary. If you didn't use
245
<userinput>mount -a</userinput>, be sure to mount proc before
248
<informalexample><screen>
250
# mount -t proc proc /proc
252
</screen></informalexample>
259
<title>Configure Keyboard</title>
263
To configure your keyboard:
265
<informalexample><screen>
267
# dpkg-reconfigure console-data
269
</screen></informalexample>
275
<title>Configure Networking</title>
278
To configure networking, edit
279
<filename>/etc/network/interfaces</filename>,
280
<filename>/etc/resolv.conf</filename>, and
281
<filename>/etc/hostname</filename>.
283
<informalexample><screen>
285
# editor /etc/network/interfaces
287
</screen></informalexample>
291
Here are some simple examples from
292
<filename>/usr/share/doc/ifupdown/examples</filename>:
294
<informalexample><screen>
295
######################################################################
296
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
297
# See the interfaces(5) manpage for information on what options are
299
######################################################################
301
# We always want the loopback interface.
304
iface lo inet loopback
309
# iface eth0 inet dhcp
311
# An example static IP setup: (broadcast and gateway are optional)
314
# iface eth0 inet static
315
# address 192.168.0.42
316
# network 192.168.0.0
317
# netmask 255.255.255.0
318
# broadcast 192.168.0.255
319
# gateway 192.168.0.1
320
</screen></informalexample>
324
Enter your nameserver(s) and search directives in
325
<filename>/etc/resolv.conf</filename>:
327
<informalexample><screen>
329
# editor /etc/resolv.conf
331
</screen></informalexample>
335
A simple <filename>/etc/resolv.conf</filename>:
337
<informalexample><screen>
339
# search hqdom.local\000
340
# nameserver 10.1.1.36
341
# nameserver 192.168.9.100
343
</screen></informalexample>
347
Enter your system's host name (2 to 63 characters):
349
<informalexample><screen>
351
# echo DebianHostName > /etc/hostname
353
</screen></informalexample>
357
If you have multiple network cards, you should arrange the names of
358
driver modules in the <filename>/etc/modules</filename> file into the
359
desired order. Then during boot, each card will be associated with the
360
interface name (eth0, eth1, etc.) that you expect.
366
<title>Configure Timezone, Users, and APT</title>
370
Set your timezone, add a normal user, and choose your <command>apt</command>
373
<informalexample><screen>
375
# /usr/sbin/base-config new
377
</screen></informalexample>
382
<title>Configure Locales</title>
385
To configure your locale settings to use a language other than
386
English, install the locales support package and configure it:
388
<informalexample><screen>
390
# apt-get install locales
391
# dpkg-reconfigure locales
393
</screen></informalexample>
395
NOTE: Apt must be configured before, ie. during the base-config phase.
396
Before using locales with character sets other than ASCII or latin1,
397
please consult the appropriate localisation HOWTO.
404
<title>Install a Kernel</title>
408
If you intend to boot this system, you probably want a Linux kernel
409
and a boot loader. Identify available pre-packaged kernels with
411
<informalexample><screen>
413
# apt-cache search kernel-image
415
</screen></informalexample>
419
Then install your choice using its package name.
421
<informalexample><screen>
423
# apt-get install kernel-image-2.X.X-arch-etc
425
</screen></informalexample>
431
<title>Set up the Boot Loader</title>
434
To make your &debian; system bootable, set up your boot loader to load
435
the installed kernel with your new root partition. Note that debootstrap
436
does not install a boot loader, though you can use apt-get inside your
437
Debian chroot to do so.
439
</para><para arch="x86">
441
Check <userinput>info grub</userinput> or <userinput>man
442
lilo.conf</userinput> for instructions on setting up the
443
bootloader. If you are keeping the system you used to install Debian, just
444
add an entry for the Debian install to your existing grub
445
<filename>menu.lst</filename> or <filename>lilo.conf</filename>. For
446
<filename>lilo.conf</filename>, you could also copy it to the new system and
447
edit it there. After you are done editing, call lilo (remember it will use
448
<filename>lilo.conf</filename> relative to the system you call it from).
450
</para><para arch="x86">
452
Here is a basic <filename>/etc/lilo.conf</filename> as an example:
454
<informalexample><screen>
458
install=/boot/boot-menu.b
464
</screen></informalexample>
466
</para><para arch="powerpc">
468
Check <userinput>man yaboot.conf</userinput> for instructions on
469
setting up the bootloader. If you are keeping the system you used to
470
install Debian, just add an entry for the Debian install to your
471
existing <filename>yaboot.conf</filename>. You could also copy it to
473
edit it there. After you are done editing, call ybin (remember it will
474
use <filename>yaboot.conf</filename> relative to the system you call it from).
476
</para><para arch="powerpc">
478
Here is a basic <filename>/etc/yaboot.conf</filename> as an example:
480
<informalexample><screen>
486
magicboot=/usr/lib/yaboot/ofboot
491
</screen></informalexample>
493
On some machines, you may need to use <userinput>ide0:</userinput>
494
instead of <userinput>hd:</userinput>.