install.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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 you will find the package files being tar'ed and
  6. gzip'ed (you can determind this 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 you how to do that once, in this paragraph.
  10. There is also the possibility that you have the ability of downloading
  11. a .tar.bz2 file. Such a file is 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 you need to have the bzip2 program installed.
  14. Most if not every distribution comes with this program so chances are
  15. high it is already installed on your system. If not, install it using
  16. your 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. When you have a file that is tar'ed and gzip'ed, you unpack it 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. When you have a file that is tar'ed and bzip2'ed, you unpack it 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. When you have a file that is tar'ed, you unpack it 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 you unpack the archives
  55. under the $LFS/usr/src directory). You have to enter that new directory
  56. before you continue with the installation instructions. So everytime the
  57. book is going to install a program, it's up to you to unpack the source
  58. archive.
  59. </para>
  60. <para>
  61. When you have a file that is gzip'ed, you unpack it by running:
  62. </para>
  63. <blockquote><literallayout>
  64. <userinput>gunzip filename.gz</userinput>
  65. </literallayout></blockquote>
  66. <para>
  67. After you have installed a package you can do two things with it. You can
  68. either delete the directory that contains the sources or you can keep it.
  69. If you decide to keep it, that's fine by me. But if you need the same package
  70. again in a later chapter you need to delete the directory first before using
  71. it again. If you don't do this, you might end up in trouble because old
  72. settings will be used (settings that apply to your normal Linux system but
  73. which don't always apply to your LFS system). Doing a simple make clean
  74. or make distclean does not always guarantee a totally clean source tree.
  75. The configure script can also have files lying around in various
  76. subdirectories which aren't always removed by a make clean process.
  77. </para>
  78. <para>
  79. There is one exception to that rule: don't remove the linux kernel source
  80. tree. A lot of programs need the kernel headers, so that's the only
  81. directory you don't want to remove, unless you are not going to
  82. compile any software anymore.
  83. </para>
  84. </sect1>