[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 |
|
---|
[11ce06a] | 16 | <para>
|
---|
| 17 | <screen>
|
---|
| 18 | <userinput>cd $LFS/usr/src</userinput>
|
---|
| 19 | </screen>
|
---|
| 20 | </para>
|
---|
[6370fa6] | 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 |
|
---|
[11ce06a] | 28 | <para>
|
---|
| 29 | <screen>
|
---|
| 30 | <userinput>tar xvzf filename.tar.gz</userinput>
|
---|
| 31 | <userinput>tar xvzf filename.tgz</userinput>
|
---|
| 32 | </screen>
|
---|
| 33 | </para>
|
---|
[6370fa6] | 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 |
|
---|
[11ce06a] | 41 | <para>
|
---|
| 42 | <screen>
|
---|
| 43 | <userinput>bzcat filename.tar.bz2 | tar xv</userinput>
|
---|
| 44 | </screen>
|
---|
| 45 | </para>
|
---|
[6370fa6] | 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 |
|
---|
[11ce06a] | 59 | <para>
|
---|
| 60 | <screen>
|
---|
| 61 | <userinput>tar xvf filename.tar</userinput>
|
---|
| 62 | </screen>
|
---|
| 63 | </para>
|
---|
[6370fa6] | 64 |
|
---|
| 65 | <para>
|
---|
[0646a5a] | 66 | When an 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 |
|
---|
[11ce06a] | 84 | <para>
|
---|
| 85 | <screen>
|
---|
| 86 | <userinput>gunzip filename.gz</userinput>
|
---|
| 87 | </screen>
|
---|
| 88 | </para>
|
---|
[a9f0291] | 89 |
|
---|
[ff9fe017] | 90 | <para>
|
---|
| 91 | If a file is bzip2'ed, it is unpacked by running:
|
---|
[0375b34] | 92 | </para>
|
---|
[ff9fe017] | 93 |
|
---|
[11ce06a] | 94 | <para>
|
---|
| 95 | <screen>
|
---|
| 96 | <userinput>bunzip2 filename.bz2</userinput>
|
---|
| 97 | </screen>
|
---|
| 98 | </para>
|
---|
[ff9fe017] | 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 |
|
---|
[bea68d8] | 117 | <para>
|
---|
| 118 | There is one exception; the kernel source tree. Keep it around as you
|
---|
| 119 | will need it later in this book when building a kernel. Nothing will use
|
---|
| 120 | the kernel tree so it won't be in your way.
|
---|
| 121 | </para>
|
---|
| 122 |
|
---|
[6370fa6] | 123 | </sect1>
|
---|
| 124 |
|
---|