The bzip2 and libbzip2 home page The bzip2 and libbzip2 official home page The master version of this page lives at http://sources.redhat.com/bzip2/, and new stuff, mainly executables, will appear there first. The current stable version of bzip2 is 1.0.2. What is bzip2? Why would I want to use it? Getting the latest version - bzip2-1.0.2 (released 26 Jan 2002) Documentation Getting an older version What's your day job? Other stuff I did: cacheprof, a memory effects profiler What is bzip2? bzip2 is a freely available, patent free (see below), high-quality data compressor. It typically compresses files to within 10% to 15% of the best available techniques (the PPM family of statistical compressors), whilst being around twice as fast at compression and six times faster at decompression. Why would I want to use it? Because it compresses well. So it packs more stuff into your overfull disk drives, distribution CDs, floppy disks, Zip disks, backup tapes, ... whatever. And/or it reduces your phone bills, customer download times, long distance network traffic, ... whatever. Pretty obvious really. Who's arguing? It's not the world's fastest compressor, but it's still fast enough to be plenty useful. Because it's open-source (BSD-style license), and, as far as I know, patent-free. (To the best of my knowledge. I can't afford to do a full patent search, so I can't guarantee this. Caveat emptor). So you can use it for whatever you like. Naturally, the source code is part of the distribution. Because it supports (limited) recovery from media errors. If you are trying to restore compressed data from a backup tape or disk, and that data contains some errors, bzip2 may still be able to decompress those parts of the file which are undamaged. Because you already know how to use it. bzip2's command line flags are similar to those of GNU Gzip, so if you know how to use gzip, you know how to use bzip2. Because it's very portable. It should run on any 32 or 64-bit machine with an ANSI C compiler. The distribution should compile unmodified on Unix and Win32 systems. Earlier versions have been ported with little difficulty to a large number of weird and wonderful systems. Because the documentation tells you how and to what extent I've tested it, and you can decide for yourself whether or not to entrust your data to it. For 1.0.0, the test volume is about 6 gigabytes in circa 120,000 files. The code is organised as a library, with a programming interface. The bzip2 program itself is a client of the library. You can use the library in your own programs, to directly read and write .bz2 files, or even just to compress data in memory using the bzip2 algorithms. Getting the latest version: bzip2-1.0.2 1.0.2 is a minor maintenance release which fixes some security holes and various minor problems in 1.0.0/1.0.1. See the CHANGES file in the sources for details. Upgrading to 1.0.2 is recommended. Executables for 1.0.2 First off, here are some executables I've collected. I hope to expand this list over time. Because 1.0.2 is pretty new, this list is very small. If your system isn't listed, there may be an older version available: see the next section. As with previous releases, I will expand this list as people donate executables for other systems. Please read the notes on executables before downloading. You might avoid some common problems. PC, Linux 2.4.9 (Red Hat 7.2, x86), statically linked. PC, OpenBSD 2.8 (x86), statically linked. PC, Windows 95/98/ME/NT/2000/XP. Use this if you are a Windows user and are not using Cygwin. If you've never heard of Cygwin, you're unlikely to be using it. This executable was built on a Windows 2000 SP 2 machine; I have no idea if it actually works on 95/98/ME/NT/XP. Sources Here's the source code, including full documentation. For the paranoid, some MD5 sums: ee76864958d568677f03db8afad92beb v102/bzip2-1.0.2.tar.gz 770135dc94369cb3eb6013ed505c8dc5 v100/bzip2-1.0.1.tar.gz 8a3f6d1d9e4072bb3c7aeae6578ae6ca v095/bzip2-0.9.5d.tar.gz 29993af5282e817fafc5a76b4e0c98fa v090/bzip2-0.9.0c.tar.gz 11fe7b9615eb84326712cb41671a7103 v01pl2/bzip2-0.1pl2.tar.gz If you can be bothered, please email me to say you've got a copy. It's nice to know where this stuff gets to. Documentation Here's the HTML version of the complete manual. And here's the postscript and PDF versions. Many people have asked about Y2K issues in bzip2. Here's a short statement. Contributed stuff David Fetter maintains a bzip2-HOWTO document. Some notes on executables: If Netscape tries to display the executable as text rather than saving it to disk, try cancelling the operation. Instead, do shift-Click, or right-click on the link to get a menu. Similar tricks (a right-click?) will probably get you a menu in Internet Explorer, with which to save the file. I hope that these executables work correctly and don't do nasty things, but can't guarantee that, since I have no way to test most of them. If you're as paranoid as I am, and want to use bzip2 to compress Extremely Important Data, you might want to build it from the source code. It's really very easy. That way you get a self-test of the program, which might catch unforseen nasties on obscure machine/OS combinations. Here's the Unix man page, so you can see properly how to use it. For full documentation, download the source bundle or see the documentation section. Getting an older version Here's a list of increasingly ancient executables for increasingly ancient platforms. Try these if you can't get a 1.0.2 executable for your platform, and you can't build 1.0.2 from source. Be hereby warned that newer versions are more secure, more featureful and faster, so it's much preferable to use the latest version (1.0.2). Please read the notes on executables before downloading. That said, here's the long list of executables for old platforms: Version 1.0.0 (and 1.0.1; these are functionally identical) PC, Linux 2.0.36, statically linked. PC, Windows 95/98/NT/2000. PC, Cygwin b20.1 on Windows 2000. Sun Sparc, Solaris 7, statically linked. PC, Solaris 7-x86, statically linked. PC, OS/2 v 3.0 FreeBSD: get a port from ftp://ftp.freebsd.org/pub/FreeBSD/ports The compression library underlying 1.0.0/1.0.1 There's increasing demand for the library as a DLL (Win32) or as Unix dynamic shared objects (.so's). Here are some. Linux users, you first need to find out which libc version you have, by doing 'ls /lib/*libc-*'. PC, Linux 2.2.5 (Red Hat 6.0, glibc-2.1.1) PC, Linux 2.0.36 (Red Hat 5.2, libc-2.0.7) A DLL for Windows 95/98/NT/2000. Sun Sparc, Solaris. A shared library is supplied as standard with Solaris 8. For earlier versions of Solaris, you might want to try http://www.sunfreeware.com, or you might be able to build a .so without much difficulty from the sources. Version 0.9.5d PC, OS/2 v3.0. Sun Sparc, Solaris 2.6 Alpha, Digital Unix 4.0 SGI, Irix 6.5 PC running Solaris 2.7 (Solaris 7) HP-PA, HPUX 10.20 IBM RS/6000, AIX 4.2 Version 0.9.0b PC, Linux 2.0 Sun Sparc, Solaris 2.5 Sun Sparc, SunOS 4.1 PC, Windows 95/NT DEC Alpha, Digital Unix 4.0 IBM RS/6000, AIX 3.2.5 SGI, Irix 6.4 PC, OS/2 v3.0 HP PA/RISC, HPUX 10.20 PC, Solaris 2.6 Amiga (m68k and PPC) Macintosh (finally!)  Click here for the MacBzip2 home page. If your machine isn't listed here, don't despair. bzip2 is very portable. It should run on practically any 32 or 64 bit computer, if you have enough spare memory (at least 8 megabytes). If you have an ANSI C compiler, you have a very good chance of building a working executable from the sources with minimal difficulty. TO USE: Rename the file you've got to plain "bzip2" (or "bzip2.exe", on Win95/98/NT/2000), and use it. Unix folks will also need to set the permissions suitably ("chmod u+x bzip2"). To decompress a .bz2 file, do "bzip2 -d my_file.bz2". Remember, the one program does both compression and decompression. To get decompression by default, copy "bzip2.exe" to "bunzip2.exe" (Win95/98/NT/2000), or symlink "bzip2" to "bunzip2" (Unix users). What's your day job? I'm an (experimental) compiler-writer by trade. At the moment I work as a research assistant for Glasgow University, helping develop a compiler for the functional language Haskell. The Glasgow Haskell compiler serves as a testbed for research into Haskell, and at the same time is a stable, well regarded, freely available, state of the art optimising compiler for Haskell. It's available for most major platforms. Perhaps you'd care to give it a spin. It's open source. Naturally. In the more distant past, I worked for five years on parallelising compilers for functional languages at the University of Manchester, UK. I'm a big fan of Haskell, an elegant and useful functional language. Getting a bit bored with C? Try doing some lazy functional programming in Haskell. It'll change the way you think about programming. Permanently. I'm a member of the ACM, which I think is a fine organisation. You can reach me by email through ACM, or via a more direct route. Other stuff I did: cacheprof Memory effects have a big effect on the performance of programs -- especially bzip2. I tried and failed to find a decent, open-source tool which would tell me exactly which lines of code produce cache misses, and in the end I wrote my own. It's a useful performance analysis tool, and I think it totally Kicks Ass. Your opinion may differ. In any case, you can get it from http://www.cacheprof.org. Julian Seward (jseward@acm.org). Last updated 26 January 2002.