1
<!-- retain these comments for translator revision tracking -->
2
<!-- original version: 15442 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>glibc</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> (Network-connected)</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 woody version &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 woody \
169
/mnt/debinst http://http.us.debian.org/debian
171
</screen></informalexample>
178
<title>Run <command>debootstrap</command>
179
(Using <filename>basedebs.tar</filename>)</title>
182
<command>debootstrap</command> can use the
183
<filename>basedebs.tar</filename> file, if you have already downloaded
184
it ahead of time. The <filename>basedebs.tar</filename> file is
185
generated only every once in a while, so you'll get the latest version
186
of the base system by pointing <command>debootstrap</command> directly
187
to a Debian archive as shown in the previous section.
191
The <filename>basedebs.tar</filename> file is found in the
192
<filename>base-images-current</filename> directory of the Debian
193
archive for your architecture, for example:
194
<ulink url="http://http.us.debian.org/debian/dists/woody/main/disks-&architecture;/base-images-current/basedebs.tar"></ulink>
198
Substitute one of the following for <replaceable>ARCH</replaceable> in the
199
<command>debootstrap</command> command:
201
<userinput>alpha</userinput>,
202
<userinput>arm</userinput>,
203
<userinput>hppa</userinput>,
204
<userinput>i386</userinput>,
205
<userinput>ia64</userinput>,
206
<userinput>m68k</userinput>,
207
<userinput>mips</userinput>,
208
<userinput>mipsel</userinput>,
209
<userinput>powerpc</userinput>,
210
<userinput>s390</userinput>, or
211
<userinput>sparc</userinput>.
212
<informalexample><screen>
214
$ /usr/sbin/debootstrap --arch ARCH --unpack-tarball \
215
/path-to-downloaded/basedebs.tar woody /mnt/debinst
217
</screen></informalexample>
222
<title>Configure The Base System</title>
226
Now you've got a real Debian system, though rather lean, on disk.
227
<command>Chroot</command> into it:
229
<informalexample><screen>
231
$ chroot /mnt/debinst /bin/bash
233
</screen></informalexample>
237
<title>Mount Partitions</title>
240
You need to create <filename>/etc/fstab</filename>.
242
<informalexample><screen>
246
</screen></informalexample>
250
Here is a sample you can modify to suit:
252
<informalexample><screen>
254
# /etc/fstab: static file system information.
256
# file system mount point type options dump pass
257
/dev/XXX / ext2 defaults 0 0
258
/dev/XXX /boot ext2 ro,nosuid,nodev 0 2
260
/dev/XXX none swap sw 0 0
261
proc /proc proc defaults 0 0
263
/dev/fd0 /mnt/floppy auto noauto,rw,sync,user,exec 0 0
264
/dev/cdrom /mnt/cdrom iso9660 noauto,ro,user,exec 0 0
266
/dev/XXX /tmp ext2 rw,nosuid,nodev 0 2
267
/dev/XXX /var ext2 rw,nosuid,nodev 0 2
268
/dev/XXX /usr ext2 rw,nodev 0 2
269
/dev/XXX /home ext2 rw,nosuid,nodev 0 2
271
</screen></informalexample>
275
Use <userinput>mount -a</userinput> to mount all the file systems you
276
have specified in your <filename>/etc/fstab</filename>, or to mount
277
file systems individually use:
279
<informalexample><screen>
281
# mount /path # e.g.: mount /usr
283
</screen></informalexample>
287
You can mount the proc file system multiple times and to arbitrary
288
locations, though /proc is customary. If you didn't use
289
<userinput>mount -a</userinput>, be sure to mount proc before
292
<informalexample><screen>
294
# mount -t proc proc /proc
296
</screen></informalexample>
301
A RedHat user reports that on his system, this should be
303
<informalexample><screen>
305
# mount -t none proc /proc
307
</screen></informalexample>
312
<title>Configure Keyboard</title>
316
To configure your keyboard:
318
<informalexample><screen>
320
# dpkg-reconfigure console-data
322
</screen></informalexample>
328
<title>Configure Networking</title>
331
To configure networking, edit
332
<filename>/etc/network/interfaces</filename>,
333
<filename>/etc/resolv.conf</filename>, and
334
<filename>/etc/hostname</filename>.
336
<informalexample><screen>
338
# editor /etc/network/interfaces
340
</screen></informalexample>
344
Here are some simple examples from
345
<filename>/usr/share/doc/ifupdown/examples</filename>:
347
<informalexample><screen>
348
######################################################################
349
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
350
# See the interfaces(5) manpage for information on what options are
352
######################################################################
354
# We always want the loopback interface.
357
iface lo inet loopback
362
# iface eth0 inet dhcp
364
# An example static IP setup: (broadcast and gateway are optional)
367
# iface eth0 inet static
368
# address 192.168.0.42
369
# network 192.168.0.0
370
# netmask 255.255.255.0
371
# broadcast 192.168.0.255
372
# gateway 192.168.0.1
373
</screen></informalexample>
377
Enter your nameserver(s) and search directives in
378
<filename>/etc/resolv.conf</filename>:
380
<informalexample><screen>
382
# editor /etc/resolv.conf
384
</screen></informalexample>
388
A simple <filename>/etc/resolv.conf</filename>:
390
<informalexample><screen>
392
# search hqdom.local\000
393
# nameserver 10.1.1.36
394
# nameserver 192.168.9.100
396
</screen></informalexample>
400
Enter your system's host name (2 to 63 characters):
402
<informalexample><screen>
404
# echo DebianHostName > /etc/hostname
406
</screen></informalexample>
410
If you have multiple network cards, you should arrange the names of
411
driver modules in the <filename>/etc/modules</filename> file into the
412
desired order. Then during boot, each card will be associated with the
413
interface name (eth0, eth1, etc.) that you expect.
419
<title>Configure Timezone, Users, and APT</title>
423
Set your timezone, add a normal user, and choose your <command>apt</command>
426
<informalexample><screen>
428
# /usr/sbin/base-config
430
</screen></informalexample>
435
<title>Configure Locales</title>
438
To configure your locale settings to use a language other than
439
English, install the locales support package and configure it:
441
<informalexample><screen>
443
# apt-get install locales
444
# dpkg-reconfigure locales
446
</screen></informalexample>
448
NOTE: Apt must be configured before, ie. during the base-config phase.
449
Before using locales with character sets other than ASCII or latin1,
450
please consult the appropriate localisation HOWTO.
457
<title>Install a Kernel</title>
461
If you intend to boot this system, you probably want a Linux kernel
462
and a boot loader. Identify available pre-packaged kernels with
464
<informalexample><screen>
466
# apt-cache search kernel-image
468
</screen></informalexample>
472
Then install your choice using its package name.
474
<informalexample><screen>
476
# apt-get install kernel-image-2.X.X-arch-etc
478
</screen></informalexample>
484
<title>Set up the Boot Loader</title>
487
To make your &debian; system bootable, set up your boot loader to load
488
the installed kernel with your new root partition.
490
</para><para arch="i386">
492
Check <userinput>man lilo.conf</userinput> for instructions on setting
493
up the bootloader. If you are keeping the system you used to install
494
Debian, just add an entry for the Debian install to your existing
495
lilo.conf. You could also copy it to the new system and edit it
496
there. After you are done editing, call lilo (remember it will use
497
lilo.conf relative to the system you call it from).
499
</para><para arch="i386">
501
Here is a basic /etc/lilo.conf as an example:
503
<informalexample><screen>
507
install=/boot/boot-menu.b
513
</screen></informalexample>
515
</para><para arch="powerpc">
517
Check <userinput>man yaboot.conf</userinput> for instructions on
518
setting up the bootloader. If you are keeping the system you used to
519
install Debian, just add an entry for the Debian install to your
520
existing yaboot.conf. You could also copy it to the new system and
521
edit it there. After you are done editing, call ybin (remember it will
522
use yaboot.conf relative to the system you call it from).
524
</para><para arch="powerpc">
526
Here is a basic /etc/yaboot.conf as an example:
528
<informalexample><screen>
534
magicboot=/usr/lib/yaboot/ofboot
539
</screen></informalexample>
541
On some machines, you may need to use <userinput>ide0:</userinput>
542
instead of <userinput>hd:</userinput>.
544
</para><para arch="not-i386;not-powerpc">
546
<phrase condition="FIXME">
547
FIXME: Someone may eventually supply an example for this architecture.