http://linux.softpedia.com/get/Programming/Libraries/zlib-159.shtml
All you have to do, is to
1、download the latest version of zlib from Softpedia or via its official website (see link at the end of the article),http://www.zlib.net/
2、save the archive somewhere on your computer and extract its contents with an archive manager software.
tar –xvf file.tar //解压 tar包
tar -xvf file.tar.gz //解压tar.gz
3、Then, open a Terminal app and use the ‘cd’ command to go to the location of the extracted archive files (e.g. cd /home/softpedia/zlib-1.2.8).
4、Run the ‘./configure && make’ command to configure and compile the program, followed by the ‘make install’ command (or ‘sudo make install’ on some systems) to install the library system wide.