📄 bzip2.html
字号:
<HTML><HEAD><TITLE>Installing Bzip2-1.0.1</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.63"><LINKREL="HOME"TITLE="Linux From Scratch"HREF="../index.html"><LINKREL="UP"TITLE="Installing basic system software"HREF="../chapter06/chapter06.html"><LINKREL="PREVIOUS"TITLE="Installing Binutils-2.11.2"HREF="../chapter06/binutils.html"><LINKREL="NEXT"TITLE="Installing Ed-0.2"HREF="../chapter06/ed.html"></HEAD><BODYCLASS="sect1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Linux From Scratch: Version 3.1</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="../chapter06/binutils.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 6. Installing basic system software</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="../chapter06/ed.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="sect1"><H1CLASS="sect1"><ANAME="ch06-bzip2">6.28. Installing Bzip2-1.0.1</A></H1><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen">Estimated build time: 1 minuteEstimated required disk space: 2 MB</PRE></FONT></TD></TR></TABLE><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN2614">6.28.1. Installation of Bzip2</A></H2><P>Install Bzip2 by running the following commands:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>make -f Makefile-libbz2_so &&make bzip2recover libbz2.a &&ln -s libbz2.so.1.0.1 libbz2.so &&cp bzip2-shared /bin/bzip2 &&cp bzip2recover /bin &&cp bzip2.1 /usr/share/man/man1 &&cp bzlib.h /usr/include &&cp -a libbz2.so* /lib &&rm /usr/lib/libbz2.a &&cp libbz2.a /usr/lib &&cd /usr/lib &&ln -sf ../../lib/libbz2.so &&cd /bin &&ln -sf bzip2 bunzip2 &&ln -sf bzip2 bzcat &&cd /usr/share/man/man1 &&ln -sf bzip2.1 bunzip2.1 &&ln -sf bzip2.1 bzcat.1 &&ln -sf bzip2.1 bzip2recover.1</B></TT></PRE></FONT></TD></TR></TABLE></P><P>Although it's not strictly a part of a basic LFS system it's worthmentioning that a patch for Tar can be downloaded which enables the tarprogram to compress and uncompress using bzip2/bunzip2 easily. With aplain tar, you have to use constructions like bzcat file.tar.bz|tarxv or tar --use-compress-prog=bunzip2 -xvf file.tar.bz2 to use bzip2 andbunzip2 with tar. This patch provides the -j option so you can unpack aBzip2 archive with tar xvfj file.tar.bz2. Applying this patch will bementioned later on when the Tar package is re-installed.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN2621">6.28.2. Command explanations</A></H2><P><TTCLASS="userinput"><B>make -f Makefile-libbz2_so:</B></TT> This will cause bzip2to be built using a different Makefile file, in this case theMakefile-libbz2_so file which creates a dynamic libbz2.so library andlinks the bzip2 utilities against it.</P><P>The reason we don't use <TTCLASS="userinput"><B>make install</B></TT> is thatbzip2's make install doesn't install the shared libbz2.so, nor the bzip2binary that's linked against that library. So we have no choice but tomanually install the files.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN2627">6.28.3. Contents</A></H2><P>The Bzip2 packages contains the bunzip2, bzcat, bzip2 and bzip2recover programs.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN2630">6.28.4. Description</A></H2><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN2632">6.28.4.1. bunzip2</A></H3><P>Bunzip2 decompresses files that are compressed with bzip2.</P></DIV><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN2635">6.28.4.2. bzcat</A></H3><P>bzcat (or bzip2 -dc) decompresses all specified files to the standard output.</P></DIV><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN2638">6.28.4.3. bzip2</A></H3><P>bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. Compression is generally considerably better than that achieved by more conventional LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors.</P></DIV><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN2641">6.28.4.4. bzip2recover</A></H3><P>bzip2recover recovers data from damaged bzip2 files.</P></DIV></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN2644">6.28.5. Dependencies</A></H2><P>Bzip2-1.0.1 needs the following to be installed:</P><PCLASS="literallayout"><br>sh from the bash package<br><br>ar from the binutils package<br>as from the binutils package<br>ld from the binutils package<br><br>cp from the fileutils package<br>ln from the fileutils package<br>rm from the fileutils package<br><br>gcc from the gcc package<br><br>make from the make package<br></P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="../chapter06/binutils.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../index.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="../chapter06/ed.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Installing Binutils-2.11.2</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../chapter06/chapter06.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Installing Ed-0.2</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -