install.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <sect1 id="ch02-install">
  2. <title>How to install the software</title>
  3. <para>
  4. Before you can actually start doing something with a package, you need
  5. to unpack it first. Often the package files are tar'ed and
  6. gzip'ed. (That can be 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 explain 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 more commonly used gzip does.
  13. In 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
  16. using 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:
  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. The above construction works no matter how
  45. your host system decided to patch bzip2.
  46. </para>
  47. <para>
  48. If a file is just tar'ed, it is unpacked by running:
  49. </para>
  50. <blockquote><literallayout>
  51. <userinput>tar xvf filename.tar</userinput>
  52. </literallayout></blockquote>
  53. <para>
  54. When the archive is unpacked, a new directory will be created under the
  55. current directory (and this book assumes that the archives are unpacked
  56. under the $LFS/usr/src directory). Please enter that new directory
  57. before continuing with the installation instructions. Again, every time
  58. this book is going to install a package, it's up to you to unpack the source
  59. archive and cd into the newly created directory.
  60. </para>
  61. <para>
  62. From time to time you will be dealing with single files such as patch
  63. files. These files are generally gzip'ed or bzip2'ed. Before such files
  64. can be used they need to be uncompressed first.
  65. </para>
  66. <para>
  67. If a file is gzip'ed, it is unpacked by running:
  68. </para>
  69. <blockquote><literallayout>
  70. <userinput>gunzip filename.gz</userinput>
  71. </literallayout></blockquote>
  72. <para>
  73. If a file is bzip2'ed, it is unpacked by running:
  74. </para>
  75. <blockquote><literallayout>
  76. <userinput>bunzip2 filename.bz2</userinput>
  77. </literallayout></blockquote>
  78. <para>
  79. After a package is installed, two things can be done with it:
  80. either the directory that contains the sources can be deleted,
  81. or it can be kept. If it is kept, that's fine with me, but if the
  82. same package is needed again in a later chapter, the directory
  83. needs to be deleted first before using it again. If this is not done,
  84. you might end up in trouble because old settings will be used (settings
  85. that apply to the host system but which don't always apply to
  86. the LFS system). Doing a simple make clean or make distclean does not
  87. always guarantee a totally clean source tree.
  88. </para>
  89. <para>
  90. There is one exception to that rule: don't remove the Linux kernel source
  91. tree. A lot of programs need the kernel headers, so that's the only
  92. directory that should not be removed, unless no software is to be compiled
  93. anymore.
  94. </para>
  95. </sect1>