source: introduction/important/unpacking.xml@ cf43c83

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since cf43c83 was 4122007, checked in by Bruce Dubbs <bdubbs@…>, 20 years ago

Initial update with new xml style

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@2285 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 4.0 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="intro-important-unpacking">
9<?dbhtml filename="unpacking.html"?>
10<title>Notes on downloading, unpacking and compiling software</title>
11
12<para>Those people who have built a <acronym>LFS</acronym> system will be aware
13of the general principles of downloading and unpacking software. We will
14however repeat some of that information here for those new to building
15their own software.</para>
16
17<para>Each set of installation instructions contains a <acronym>URL</acronym>
18from which you can download the package. We do however keep a selection of
19patches available via http. These are referenced as needed in the
20installation instructions.</para>
21
22<para>While you can keep the source <acronym>TAR</acronym> balls anywhere you like, we
23assume that you have unpacked them and unzipped any required patches
24into <filename>/usr/src</filename>.</para>
25
26<para>We can not emphasize strongly enough that you should start from a
27<emphasis>clean source tree</emphasis> each time. This means that if
28you have had an error, it's usually best to delete the source tree and
29re-unpack it <emphasis>before</emphasis> trying again. This obviously
30doesn't apply if you're an advanced user used to hacking Makefiles and C
31code, but if in doubt, start from a clean tree.</para>
32
33<sect2>
34<title>Unpacking the software</title>
35
36<para>If a file is tar'ed and gzip'ed, it is unpacked by running one of
37the following two commands, depending on the filename:</para>
38
39<screen><command>tar -xvzf filename.tar.gz
40tar -xvzf filename.tgz
41tar -xvzf filename.tar.Z</command></screen>
42
43<para>If a file is tar'ed and bzip2'ed, it can usually be unpacked by
44running:</para>
45
46<screen><command>tar -jxvf filename.tar.bz2</command></screen>
47
48<para>You can also use a slightly different method:</para>
49
50<screen><command>bzcat filename.tar.bz2 | tar -xv</command></screen>
51
52<para>Finally, you need to be able to unpack patches which are generally
53not tar'ed. The best way to do this is to copy the patch file to
54<filename>/usr/src</filename> and then to run one of the following
55commands depending on whether the file is .gz or .bz2:</para>
56
57<screen><command>gunzip patchname.gz
58bunzip2 patchname.bz2</command></screen>
59
60</sect2>
61
62<sect2>
63<title>Verifying file integrity using md5sum</title>
64
65<para>Generally, to verify that the downloaded file is genuine and complete,
66most package maintainers also distribute md5sums of the files.
67To verify the md5sum of the downloaded files, download both the file and the
68corresponding md5sum file to the same directory (preferably from different
69on-line locations), and (assuming file.md5sum is the md5sum file downloaded)
70run the following command:</para>
71
72<screen><command>md5sum -c file.md5sum</command></screen>
73
74<para>If there are any errors, they will be reported.</para>
75
76</sect2>
77
78<sect2>
79<title>Creating Log files during installation</title>
80
81<para>For larger packages, it is convenient to create log files instead of
82staring at the screen hoping to catch a particular error or warning. Log files
83are also useful for debugging and keeping records. The following command
84allows you to create an installation log. Replace &lt;command&gt; with the
85command you intend to execute.</para>
86
87<screen><command>( &lt;command&gt; 2&gt;&amp;1 | tee compile.log &amp;&amp; exit $PIPESTATUS )</command></screen>
88
89<para><parameter>2&gt;&amp;1</parameter> redirects error messages
90to the same location as standard output. The <command>tee</command> command
91allows viewing of the output while logging the results to a file. The parentheses
92around the command run the entire command in a subshell and finally the
93<command>exit $PIPESTATUS</command> ensures the result of the &lt;command&gt;
94is returned as the result and not the result of the <command>tee</command> command.</para>
95
96</sect2>
97
98</sect1>
Note: See TracBrowser for help on using the repository browser.