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