install.xml 3.4 KB

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