install.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <sect1 id="ch02-install">
  2. <title>How to install the software</title>
  3. <para>
  4. Before a user can actually start doing something with a package, he needs
  5. to unpack it first. Often the package files are tar'ed and
  6. gzip'ed. (That can determined by looking at the extension of the file.
  7. Tar'ed and gzip'ed archives have a .tar.gz or .tgz extension, for
  8. example.) I'm not going to write down every time how to ungzip and how
  9. to untar an archive. I will tell how to do that once, in this section.
  10. There is also the possibility that a .tar.bz2 file could be downloaded.
  11. Such a file would be tar'ed and compressed with the bzip2 program.
  12. Bzip2 achieves a better compression than the commonly used gzip does. In
  13. order to use bz2 archives, the bzip2 program needs to be installed.
  14. Most if not every distribution comes with this program, so chances are
  15. high it is already installed on the host system. If not, it's installed using
  16. the distribution's installation tool.
  17. </para>
  18. <para>
  19. To start with, change to the $LFS/usr/src directory by running:
  20. </para>
  21. <blockquote><literallayout>
  22. <userinput>cd $LFS/usr/src</userinput>
  23. </literallayout></blockquote>
  24. <para>
  25. If a file is tar'ed and gzip'ed, it is unpacked by
  26. running either one of the following two commands, depending on the
  27. filename format:
  28. </para>
  29. <blockquote><literallayout>
  30. <userinput>tar xvzf filename.tar.gz</userinput>
  31. <userinput>tar xvzf filename.tgz</userinput>
  32. </literallayout></blockquote>
  33. <para>
  34. If a file is tar'ed and bzip2'ed, it is unpacked by
  35. running:
  36. </para>
  37. <blockquote><literallayout>
  38. <userinput>bzcat filename.tar.bz2 | tar xv</userinput>
  39. </literallayout></blockquote>
  40. <para>
  41. Some tar programs (most of them nowadays but not all of them) are
  42. slightly modified to be able to use bzip2 files directly using either
  43. the I or the y tar parameter, which works the same as the z tar parameter
  44. to handle gzip archives.
  45. </para>
  46. <para>
  47. If a file is just tar'ed, it is unpacked by running:
  48. </para>
  49. <blockquote><literallayout>
  50. <userinput>tar xvf filename.tar</userinput>
  51. </literallayout></blockquote>
  52. <para>
  53. When the archive is unpacked, a new directory will be created under the
  54. current directory (and this document assumes that the archives are unpacked
  55. under the $LFS/usr/src directory). A user has to enter that new directory
  56. before continuing with the installation instructions. So, every time the
  57. book is going to install a program, it's up to the user to unpack the source
  58. archive.
  59. </para>
  60. <para>
  61. If a file is gzip'ed, it is unpacked by running:
  62. </para>
  63. <blockquote><literallayout>
  64. <userinput>gunzip filename.gz</userinput>
  65. </literallayout></blockquote>
  66. <para>
  67. After a package is installed, two things can be done with it:
  68. either the directory that contains the sources can be deleted,
  69. either it can be kept.
  70. If it is kept, that's fine with me, but if the same package is needed
  71. again in a later chapter, the directory needs to be deleted first before using
  72. it again. If this is not done, it might end up in trouble because old
  73. settings will be used (settings that apply to the normal Linux system but
  74. which don't always apply to the LFS system). Doing a simple make clean
  75. or make distclean does not always guarantee a totally clean source tree.
  76. The configure script can also have files lying around in various
  77. subdirectories which aren't always removed by a make clean process.
  78. </para>
  79. <para>
  80. There is one exception to that rule: don't remove the linux kernel source
  81. tree. A lot of programs need the kernel headers, so that's the only
  82. directory that should not be removed, unless no software is to be compiled
  83. anymore.
  84. </para>
  85. </sect1>