[6370fa6] | 1 | <sect1 id="ch02-install">
|
---|
| 2 | <title>How to install the software</title>
|
---|
| 3 |
|
---|
| 4 | <para>
|
---|
[ff9fe017] | 5 | Before you can actually start doing something with a package, you need
|
---|
[aff91c4] | 6 | to unpack it first. Often the package files are tar'ed and
|
---|
[b8cf8df] | 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.
|
---|
[6370fa6] | 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>
|
---|
[aff91c4] | 23 | If a file is tar'ed and gzip'ed, it is unpacked by
|
---|
[6370fa6] | 24 | running either one of the following two commands, depending on the
|
---|
[ff9fe017] | 25 | filename:
|
---|
[6370fa6] | 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>
|
---|
[aff91c4] | 37 | If a file is tar'ed and bzip2'ed, it is unpacked by
|
---|
[6370fa6] | 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
|
---|
[87c057b] | 50 | the I or the y tar parameter, which works the same as the z tar parameter
|
---|
[ff9fe017] | 51 | to handle gzip archives. The above construction works no matter how
|
---|
| 52 | your host system decided to patch bzip2.
|
---|
[6370fa6] | 53 | </para>
|
---|
| 54 |
|
---|
| 55 | <para>
|
---|
[aff91c4] | 56 | If a file is just tar'ed, it is unpacked by running:
|
---|
[6370fa6] | 57 | </para>
|
---|
| 58 |
|
---|
| 59 | <blockquote><literallayout>
|
---|
| 60 |
|
---|
| 61 | <userinput>tar xvf filename.tar</userinput>
|
---|
| 62 |
|
---|
| 63 | </literallayout></blockquote>
|
---|
| 64 |
|
---|
| 65 | <para>
|
---|
[b8cf8df] | 66 | When ab archive is unpacked, a new directory will be created under the
|
---|
[cc107b1] | 67 | current directory (and this book assumes that the archives are unpacked
|
---|
[ff9fe017] | 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.
|
---|
[6370fa6] | 78 | </para>
|
---|
| 79 |
|
---|
[a9f0291] | 80 | <para>
|
---|
[87c057b] | 81 | If a file is gzip'ed, it is unpacked by running:
|
---|
[a9f0291] | 82 | </para>
|
---|
| 83 |
|
---|
| 84 | <blockquote><literallayout>
|
---|
| 85 |
|
---|
| 86 | <userinput>gunzip filename.gz</userinput>
|
---|
| 87 |
|
---|
| 88 | </literallayout></blockquote>
|
---|
| 89 |
|
---|
[ff9fe017] | 90 | <para>
|
---|
| 91 | If a file is bzip2'ed, it is unpacked by running:
|
---|
[0375b34] | 92 | </para>
|
---|
[ff9fe017] | 93 |
|
---|
| 94 | <blockquote><literallayout>
|
---|
| 95 |
|
---|
| 96 | <userinput>bunzip2 filename.bz2</userinput>
|
---|
| 97 |
|
---|
| 98 | </literallayout></blockquote>
|
---|
| 99 |
|
---|
[6370fa6] | 100 | <para>
|
---|
[b8cf8df] | 101 | After a package has been installed, two things can be done with it:
|
---|
[87c057b] | 102 | either the directory that contains the sources can be deleted,
|
---|
[cc107b1] | 103 | or it can be kept. If it is kept, that's fine with me, but if the
|
---|
[ff9fe017] | 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
|
---|
[cc107b1] | 107 | that apply to the host system but which don't always apply to
|
---|
[ff9fe017] | 108 | the LFS system). Doing a simple make clean or make distclean does not
|
---|
| 109 | always guarantee a totally clean source tree.
|
---|
[6370fa6] | 110 | </para>
|
---|
| 111 |
|
---|
[b8cf8df] | 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 |
|
---|
[6370fa6] | 117 | <para>
|
---|
[cc107b1] | 118 | There is one exception to that rule: don't remove the Linux kernel source
|
---|
[6370fa6] | 119 | tree. A lot of programs need the kernel headers, so that's the only
|
---|
[b8cf8df] | 120 | directory that should not be removed, unless no package is to be compiled
|
---|
[aff91c4] | 121 | anymore.
|
---|
[6370fa6] | 122 | </para>
|
---|
| 123 |
|
---|
| 124 | </sect1>
|
---|
| 125 |
|
---|