Installing zlib through source code on Ubuntu Linux
This short tutorial shows you how to install zlib on Ubuntu Linux Server. The process is very simple. For this tutorial, I'll be installing zlib version 1.2.3. Linux kernel is 2.6.15-26-powerpc. I have used a Mac Mini (powerpc/ppc architecture). GCC version number is 4.0.3. Your configuration may be different from mine but the installation steps below should work fine for most configurations with little or no change at all (including other Linux distributions and even unixes e.g. MacOS X).
zlib:According to zlib.net,
"zlib is designed to be a free, general-purpose, legally unencumbered -- that is, not covered by any patents -- lossless data-compression library for use on virtually any computer hardware and operating system. The zlib data format is itself portable across platforms. Unlike the LZW compression method used in Unix compress(1) and in the GIF image format, the compression method currently used in zlib essentially never expands the data. (LZW can double or triple the file size in extreme cases.) zlib's memory footprint is also independent of the input data and can be reduced, if necessary, at some cost in compression."
Before starting, please check to see if there is a latest version available to download. Visit http://zlib.net/ to find out about the available versions. IMPORTANT: See "Configuring Ubuntu Linux After Installation" to install the development tools required to compile and install zlib from source code.
Steps to download, compile, and install are as follows. Note: Replace 1.2.3 with your version number:
Downloading zlib:Run the command below,
Extracting files from the downloaded package:
tar -xvzf zlib-1.2.3.tar.gz
Now, enter the directory where the package is extracted.
Configuring zlib Library:
Replace "/usr/local/zlib" above with the directory path where you want to copy the files and folders. Note: check for any error message.
Note: check for any error message.
As root (for privileges on destination directory), run the following.
sudo make install
Note: check for any error messages.
That’s it. Library has bee successfully installed.
Did this tutorial help a little? How about buy me a cup of coffee?
Please feel free to use the comments form below if you have any questions or need more explanation on anything. I recommend thoroughy testing on a production-like test system first before moving to production.