install.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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 or bzip2'ed. I'm not going to write down every time how to
  7. unpack an archive. I will explain how to do that once, in this
  8. section.
  9. </para>
  10. <para>
  11. To start with, change to the $LFS/usr/src directory by running:
  12. </para>
  13. <para>
  14. <screen>
  15. <userinput>cd $LFS/usr/src</userinput>
  16. </screen>
  17. </para>
  18. <para>
  19. If a file is tar'ed and gzip'ed, it is unpacked by
  20. running either one of the following two commands, depending on the
  21. filename:
  22. </para>
  23. <para>
  24. <screen>
  25. <userinput>tar xvzf filename.tar.gz</userinput>
  26. <userinput>tar xvzf filename.tgz</userinput>
  27. </screen>
  28. </para>
  29. <para>
  30. If a file is tar'ed and bzip2'ed, it is unpacked by
  31. running:
  32. </para>
  33. <para>
  34. <screen>
  35. <userinput>bzcat filename.tar.bz2 | tar xv</userinput>
  36. </screen>
  37. </para>
  38. <para>
  39. Some tar programs (most of them nowadays but not all of them) are
  40. slightly modified to be able to use bzip2 files directly using either
  41. the I or the y tar parameter, which works the same as the z tar parameter
  42. to handle gzip archives. The above construction works no matter how
  43. your host system decided to patch bzip2.
  44. </para>
  45. <para>
  46. If a file is just tar'ed, it is unpacked by running:
  47. </para>
  48. <para>
  49. <screen>
  50. <userinput>tar xvf filename.tar</userinput>
  51. </screen>
  52. </para>
  53. <para>
  54. When an 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. <para>
  70. <screen>
  71. <userinput>gunzip filename.gz</userinput>
  72. </screen>
  73. </para>
  74. <para>
  75. If a file is bzip2'ed, it is unpacked by running:
  76. </para>
  77. <para>
  78. <screen>
  79. <userinput>bunzip2 filename.bz2</userinput>
  80. </screen>
  81. </para>
  82. <para>
  83. After a package has been installed, two things can be done with it:
  84. either the directory that contains the sources can be deleted,
  85. or it can be kept. If it is kept, that's fine with me, but if the
  86. same package is needed again in a later chapter, the directory
  87. needs to be deleted first before using it again. If this is not done,
  88. you might end up in trouble because old settings will be used (settings
  89. that apply to the host system but which don't always apply to
  90. the LFS system). Doing a simple make clean or make distclean does not
  91. always guarantee a totally clean source tree.
  92. </para>
  93. <para>
  94. So, save yourself a lot of hassle and just remove the source directory
  95. immediately after you have installed it.
  96. </para>
  97. <para>
  98. There is one exception to that rule: don't remove the Linux kernel source
  99. tree. A lot of programs need the kernel headers, so that's the only
  100. directory that should not be removed, unless no package is to be compiled
  101. anymore.
  102. </para>
  103. </sect1>