zlib is an open-source data compression library licensed under a custom zlib license. The authors of this library are highly respected in the software community. Many packages I use rely on zlib for compression and decompression.
By the time you read this, it is possible that the latest version has been updated. You may want to use a newer version, but it's possible a newer version might not work the same way. To ensure a positive outcome, don't upgrade unless you have a good reason to, or if the zlib folks recommend you to do so on their website.
Zlib has no prerequisites.
As I write this, the latest version of zlib is 1.2.3. You can download this, or another version, at http://www.zlib.net/. Assuming you want to install version 1.2.3: download zlib-1.2.3.tar.gz; put this into a temporary folder, such as /tmp/zlib, and follow the rest of these instructions to install it.
$ mkdir /tmp/zlib $ cd /tmp/zlib $ wget http://www.zlib.net/zlib-1.2.3.tar.gz
$ cd /tmp/zlib $ gzip -dc < zlib-1.2.3.tar.gz | tar -xf - $ cd zlib-1.2.3
$ ./configure -s --prefix=/usr $ make
# make install
This version of zlib, when installed, produces the following files:
Sometimes you will need to install these to a different place, but most libraries expect to be found in either /lib, /usr/lib, or /usr/local/lib. If you'd rather install these files under /usr/local/lib, for instance, you should pass --prefix=/usr/local to the configure script.
I personally dislike outdated documentation. If anything here seems wrong, or perhaps did not work for you, please email me (jay@petio.org) and tell me so I can update it. Thanks!