1 | <sect1 id="ch02-install">
|
---|
2 | <title>How to install the software</title>
|
---|
3 |
|
---|
4 | <para>
|
---|
5 | Before you can actually start doing something with a package, you need
|
---|
6 | to unpack it first. Often the package files are tar'ed and
|
---|
7 | gzip'ed or bzip2'ed. I'm not going to write down every time how to
|
---|
8 | unpack an archive. I will explain how to do that once, in this
|
---|
9 | section.
|
---|
10 | </para>
|
---|
11 |
|
---|
12 | <para>
|
---|
13 | To start with, change to the $LFS/usr/src directory by running:
|
---|
14 | </para>
|
---|
15 |
|
---|
16 | <blockquote><literallayout>
|
---|
17 |
|
---|
18 | <userinput>cd $LFS/usr/src</userinput>
|
---|
19 |
|
---|
20 | </literallayout></blockquote>
|
---|
21 |
|
---|
22 | <para>
|
---|
23 | If a file is tar'ed and gzip'ed, it is unpacked by
|
---|
24 | running either one of the following two commands, depending on the
|
---|
25 | filename:
|
---|
26 | </para>
|
---|
27 |
|
---|
28 | <blockquote><literallayout>
|
---|
29 |
|
---|
30 | <userinput>tar xvzf filename.tar.gz</userinput>
|
---|
31 | <userinput>tar xvzf filename.tgz</userinput>
|
---|
32 |
|
---|
33 | </literallayout></blockquote>
|
---|
34 |
|
---|
35 |
|
---|
36 | <para>
|
---|
37 | If a file is tar'ed and bzip2'ed, it is unpacked by
|
---|
38 | running:
|
---|
39 | </para>
|
---|
40 |
|
---|
41 | <blockquote><literallayout>
|
---|
42 |
|
---|
43 | <userinput>bzcat filename.tar.bz2 | tar xv</userinput>
|
---|
44 |
|
---|
45 | </literallayout></blockquote>
|
---|
46 |
|
---|
47 | <para>
|
---|
48 | Some tar programs (most of them nowadays but not all of them) are
|
---|
49 | slightly modified to be able to use bzip2 files directly using either
|
---|
50 | the I or the y tar parameter, which works the same as the z tar parameter
|
---|
51 | to handle gzip archives. The above construction works no matter how
|
---|
52 | your host system decided to patch bzip2.
|
---|
53 | </para>
|
---|
54 |
|
---|
55 | <para>
|
---|
56 | If a file is just tar'ed, it is unpacked by running:
|
---|
57 | </para>
|
---|
58 |
|
---|
59 | <blockquote><literallayout>
|
---|
60 |
|
---|
61 | <userinput>tar xvf filename.tar</userinput>
|
---|
62 |
|
---|
63 | </literallayout></blockquote>
|
---|
64 |
|
---|
65 | <para>
|
---|
66 | When ab archive is unpacked, a new directory will be created under the
|
---|
67 | current directory (and this book assumes that the archives are unpacked
|
---|
68 | under the $LFS/usr/src directory). Please enter that new directory
|
---|
69 | before continuing with the installation instructions. Again, every time
|
---|
70 | this book is going to install a package, it's up to you to unpack the source
|
---|
71 | archive and cd into the newly created directory.
|
---|
72 | </para>
|
---|
73 |
|
---|
74 | <para>
|
---|
75 | From time to time you will be dealing with single files such as patch
|
---|
76 | files. These files are generally gzip'ed or bzip2'ed. Before such files
|
---|
77 | can be used they need to be uncompressed first.
|
---|
78 | </para>
|
---|
79 |
|
---|
80 | <para>
|
---|
81 | If a file is gzip'ed, it is unpacked by running:
|
---|
82 | </para>
|
---|
83 |
|
---|
84 | <blockquote><literallayout>
|
---|
85 |
|
---|
86 | <userinput>gunzip filename.gz</userinput>
|
---|
87 |
|
---|
88 | </literallayout></blockquote>
|
---|
89 |
|
---|
90 | <para>
|
---|
91 | If a file is bzip2'ed, it is unpacked by running:
|
---|
92 | </para>
|
---|
93 |
|
---|
94 | <blockquote><literallayout>
|
---|
95 |
|
---|
96 | <userinput>bunzip2 filename.bz2</userinput>
|
---|
97 |
|
---|
98 | </literallayout></blockquote>
|
---|
99 |
|
---|
100 | <para>
|
---|
101 | After a package has been installed, two things can be done with it:
|
---|
102 | either the directory that contains the sources can be deleted,
|
---|
103 | or it can be kept. If it is kept, that's fine with me, but if the
|
---|
104 | same package is needed again in a later chapter, the directory
|
---|
105 | needs to be deleted first before using it again. If this is not done,
|
---|
106 | you might end up in trouble because old settings will be used (settings
|
---|
107 | that apply to the host system but which don't always apply to
|
---|
108 | the LFS system). Doing a simple make clean or make distclean does not
|
---|
109 | always guarantee a totally clean source tree.
|
---|
110 | </para>
|
---|
111 |
|
---|
112 | <para>
|
---|
113 | So, save yourself a lot of hassle and just remove the source directory
|
---|
114 | immediately after you have installed it.
|
---|
115 | </para>
|
---|
116 |
|
---|
117 | <para>
|
---|
118 | There is one exception to that rule: don't remove the Linux kernel source
|
---|
119 | tree. A lot of programs need the kernel headers, so that's the only
|
---|
120 | directory that should not be removed, unless no package is to be compiled
|
---|
121 | anymore.
|
---|
122 | </para>
|
---|
123 |
|
---|
124 | </sect1>
|
---|
125 |
|
---|