glfs/introduction/important/unpacking.xml
Mark Hymers f45b195302 Initial revision
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@3 af4574ff-66df-0310-9fd7-8a98e5e911e0
2002-07-07 20:28:42 +00:00

60 lines
2.3 KiB
XML

<sect1 id="intro-important-unpacking">
<?dbhtml filename="unpacking.html" dir="introduction"?>
<title>Getting and unpacking the software</title>
<para>Those people who have built a LFS system will be aware of the
general principles of downloading and unpacking software. We will
however repeat some of that information here for those new to building
their own software.</para>
<para>One difference from the LFS book is that we do <emphasis>not</emphasis>
mirror the packages on the BLFS website.
Instead, each set of installation instructions contains a URL from which
you can download the package. We do however keep a selection of patches
available via http/ftp. These are referenced as needed in the
installation instructions.</para>
<para>Whilst you can keep the source tarballs anywhere you like, we
assume that you have unpacked them and unzipped any required patches
into <filename>/usr/src</filename>.</para>
<para>We can not emphasise strongly enough that you should start from a
<emphasis>clean source tree</emphasis> each time. This means that if
you have had an error, it's usually best to delete the source tree and
re-unpack it <emphasis>before</emphasis> trying again. This obviously
doesn't apply if you're an advanced user used to hacking Makefiles and C
code, but if in doubt, start from a clean tree.</para>
<sect2>
<title>Unpacking the software</title>
<para>If a file is tar'ed and gzip'ed, it is unpacked by running one of
the following two commands, depending on the filename:</para>
<screen><userinput>tar xvzf filename.tar.gz
tar xvzf filename.tgz
tar xvzf filename.tar.Z</userinput></screen>
<para>If a file is tar'ed and bzip2'ed, it can usually be unpacked by
running:</para>
<screen><userinput>tar jxvf filename.tar.bz2</userinput></screen>
<para>This applies as long as you patched tar to include the j option
during your LFS install. If you didn't, you can use a slightly
different method:</para>
<screen><userinput>bzcat filename.tar.bz2 | tar xv</userinput></screen>
<para>Finally, you need to be able to unpack patches which are generally
not tar'd. The best way to do this is to copy the patch file to
<filename>/usr/src</filename> and then to run one of the following
commands depending on whether the file is .gz or .bz2:</para>
<screen><userinput>gunzip patchname.gz
bunzip2 patchname.bz2</userinput></screen>
</sect2>
</sect1>