Installing zlib on linux

How to Install Zlib on Ubuntu Linux

Last updated July 8, 2021 By Abhishek Prakash 6 Comments

Zlib is an open source library for used for data compression.

As an end user, you are likely to encounter the need of installing Zlib (or zlib devel package) as a dependency of another application.

But here comes the problem. If you try installing Zlib on Ubuntu, it will throw “unable to locate package zlib” error.

Why do you see this unable to locate package error? Because there is no package named zlib.

If you use the apt search command, you’ll find that the there are a couple of packages that let you install zlib: zlib1g and zlib1g-dev. When you have that information, installing them is just one apt command away.

Install Zlib on Ubuntu-based Linux distributions

Open a terminal and use the following command:

Please keep in mind that the the letter before g is 1 (one), not lowercase L. Many people make this mistake while typing the command.

The other package, zlib1g-dev is development package. Only install it if you require it otherwise you should be good with the main runtime zlib1g package.

You may also download the source code of Zlib from its website and install it. However, I won’t recommend going the source code way just for installing zlib unless you have a good reason to do so. For example, if you need the latest or a specific version of zlib which is not available in the distribution’s repository.

It is interesting how a seemingly small stuff like installing zlib could become a pain for two reasons: a different package name and the package name containing a “hidden” numeral one (1) which is confused with lowercase L.

I hope this quick tip helps you. Feel free to drop your questions, suggestions or a simple “thank you” in the comment section.

Like what you read? Please share it with others.

Источник

Thread: How to install zlib?

Thread Tools
Display

How to install zlib?

I have to install zlib for running ./configure.
Can anyone help me doing this? I typed «sudo apt-get install zlib» but it doesn’t work.

Re: How to install zlib?

What package are you trying to compile when you run «./configure»?

It’s likely that the package you need is in the software repositories, so you don’t have to compile it manually.

Re: How to install zlib?

eAthena (ragnarok server emulator)

edit: it does have a zlib1.dll in its main folder

Читайте также:  Отключить автообновление windows 10 через службы

Re: How to install zlib?

Re: How to install zlib?

After installing zlib (from zlib website) my SO crashed. Now it doesnt start anymore. I am reinstalling.

Re: How to install zlib?

I did all again, with an ubuntu CD i formated my computer and reinstalled ubuntu.
Then i updated it, installed yakuake and zlib (http://www.zlib.net/ I downloaded: zlib source code, version 1.2.5, tar.gz format) with ./configure and make install.

When i reboot my computer, it stoped working again. (do not open login window, just go to the background image, with mouse, and stops there forever)

Does anyone know how to install zlib without crashing the whole system?

Re: How to install zlib?

Ok so I am having the same problem as you. I’ll try this when i get home and let you know if it works.

In the mean time, to fix you’re crashed system just follow these instructions:

1. Boot into recovery mode through grub and login as you’re self

2. Go to the directory you unpacked zlib

(Off hand i think the packge is zlib1g, use apt-cache —name-only search zlib or aptitude search zlib to find the one that closely matches it and run that apt-get command)

This fixed my Ubuntu after I wasted my time and reinstalled my system and tried to install zlib again. So hopefully it can work for you too.

Last edited by mortalapeman; July 12th, 2010 at 03:27 PM .

Источник

Install and enable zlib on Linux server

Why need zlib on your linux web server? zlib, gzip and mod_deflate on Apache HTTPD server compress your web pages and serve them to client’s web browsers which can save and reduce bandwidth usage. Most modern web browsers today like Google Chrome or Mozilla Firefox supports both gzip and/or deflate. Enable zlib.output_compression setting in your linux web server will allow gzip compress pages served by PHP.

zlib is a compression library, written by Jean-loup Gailly and Mark Adler. Zlib works in Linux, Mac OS, even gaming consoles like playStaion 3, Xbox 360 and Wii. Zlib uses deflate() and inflate() algorithm to compress and decompress files. To speed up your website, make sure your web hosting support PHP GZIP compression enabled. To enable gzip, you can either modify php.ini if you have root access to your VPS or dedicated server, or use .htaccess to enable zlib.

Install zlib (gzip) on Linux web server

Normally zlib is installed in your web server by default, for some reason if you don’t have zlib installed, here is the command to install zlib to your web server

For fedora, centos, or redhat based distribution

For ubuntu, or debian based distribution

Enable zlib (gzip) on Linux web server

To locate php.ini in your web server, first create info.php and save it at your web root directory, for example in public_html, or www directory

copy and paste this code to info.php and save it.

Load the info.php you just created in your web browser, since you located that info.php in the root web directory, you should be able to load that file at

Now look for “Loaded Configuration File” which where php.ini is located in your web server. Next step is to modify php.ini file to enable zlib compression.

Читайте также:  Anydesk не дает управлять мышкой mac os

Search for zlib.output_compression, default value should be off, to enable zlib, simple change to value off to on.

Next we should set the zlib.output_compression_level value to 6 which is the best compression level without reduce your server preformance. The default value of zlib.output_compression_level is -1 which let your server choose which level to use. In php.ini file, search for

Change its value to 6 and uncomment or remove “#” in front of zlib.output_compression_level

If your host does not support custom php.ini or you don’t have root access to your host, you can enable zlib by adding this code to your .htaccess at your website root directory

Another method to enable zlib (gzip) to your website without alter php.ini or .htaccess is to add this code right into your PHP scripts before any output

If you have installed Python but get this error

configure Python with

Finally run make command to generate the Python binaries.

Источник


A Massively Spiffy Yet Delicately Unobtrusive Compression Library
(Also Free, Not to Mention Unencumbered by Patents)


Welcome to the zlib home page, web pages originally created by Greg Roelofs and maintained by Mark Adler. If this page seems suspiciously similar to the PNG Home Page, rest assured that the similarity is completely coincidental. No, really.

zlib was written by Jean-loup Gailly (compression) and Mark Adler (decompression).

January 15, 2017

—> Version 1.2.11 has these key improvements over 1.2.10:

  • Fix deflate stored bug when pulling last block from window
  • Permit immediate deflateParams changes before any deflate input

Due to the bug fixes, any installations of 1.2.9 or 1.2.10 should be immediately replaced with 1.2.11.

Version 1.2.10 has these key improvements over 1.2.9:

  • Fix bug in deflate_stored() for zero-length input
  • Fix bug in gzwrite.c that produced corrupt gzip files

Version 1.2.9 has these key improvements over 1.2.8:

  • Improve compress() and uncompress() to support large lengths
  • Allow building zlib outside of the source directory
  • Fix bug when level 0 used with Z_HUFFMAN or Z_RLE
  • Fix bugs in creating a very large gzip header
  • Add uncompress2() function, which returns the input size used
  • Dramatically speed up deflation for level 0 (storing)
  • Add gzfread() and gzfwrite(), duplicating the interfaces of fread() and fwrite()
  • Add crc32_z() and adler32_z() functions with size_t lengths
  • Many portability improvements

You can also look at the complete Change Log.

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. A more precise, technical discussion of both points is available on another page.

zlib was written by Jean-loup Gailly (compression) and Mark Adler (decompression). Jean-loup is also the primary author of gzip (1), the author of the comp.compression FAQ list and the former maintainer of Info-ZIP’s Zip; Mark is also the author of gzip’s and UnZip’s main decompression routines and was the original author of Zip. Not surprisingly, the compression algorithm used in zlib is essentially the same as that in gzip and Zip, namely, the `deflate’ method that originated in PKWARE’s PKZIP 2.x.

Читайте также:  Msi afterburner linux ubuntu

Mark and Jean-loup can be reached by e-mail at . Please read the FAQ and the manual before asking us for help. We are getting too many questions which already have an answer in the zlib documentation.

The deflate and zlib specifications both achieved official Internet RFC status in May 1996, and zlib itself was adopted in version 1.1 of the Java Development Kit (JDK), both as a raw class and as a component of the JAR archive format.

The lovely zlib-vise image above was provided courtesy of Bruce Gardner, art director of Dr. Dobb’s Journal. It appears in Mark Nelson’s article in the January 1997 issue (see below).

The current release is publicly available here:

zlib source code, version 1.2.11, tar.gz format (593K, SHA-256 hash c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1):

US (zlib.net) (GPG signature) Pick a mirror (prdownloads.sourceforge.net) zlib source code, version 1.2.11, tar.xz format (457K, SHA-256 hash 4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066):

US (zlib.net) (GPG signature) Pick a mirror (prdownloads.sourceforge.net) zlib source code, version 1.2.11, zipfile format (730K, SHA-256 hash d7510a8ee1918b7d0cad197a089c0a2cd4d6df05fee22389f67f115e738b178d):

US (zlib.net) (GPG signature) Pick a mirror (prdownloads.sourceforge.net) zlib compiled DLL, version 1.2.11, zipfile format (xxK, SHA256 checksum ):

US (zlib.net) Pick a mirror (prdownloads.sourceforge.net) —>

Note that zlib is an integral part of libpng and has been tested extensively as part of many PNG-supporting applications.

zlib Information


CRC (Cyclic Redundancy Check) Bonus Information


ZIP File Processing Bonus Software


Send comments or questions about zlib to the authors at after checking FAQ and manual.
Please report broken links to (PGP key).

Источник

zlib requirement on Alpine Linux #1763

Comments

mattchen commented Mar 8, 2016

hey, I was trying to install Pillow on Alpine Linux 3.3 official docker container by «pip install pillow», but I get this error:

ValueError: —enable-zlib requested but zlib not found, aborting.

I have installed all the zlib library as I know, zlib-dev, libzip-dev by «apk add», and I checked /usr/include/libzip.h, which is 1.2.8, I’m not sure if there’s something wrong with the library file or filename.

UPDATE: After I copied /lib/libz.so and /lib/libz.a to /usr/lib/ (which is installed by default), the installation has finished successfully. Guess /lib/ should be in the library check list?

The text was updated successfully, but these errors were encountered:

wiredfool commented Mar 8, 2016

The library it’s looking for is zlib and zlib.h. libzip is something else (zip archives).

It looks like we’re not actually looking in /lib on linux machines since most of the distros have shifted to multiarch library paths. It’s certainly possible to add it by setting the environment variables C_INCLUDE_PATH/CPATH/INCLUDE and LD_RUN_PATH/LIBRARY_PATH/LIB.

(It’s also possible that one of those paths has been added from the python config, which may be why /usr/lib works on Alpine)

And as an aside, that error should have been `’%s is required unless explicitly disabled using —disable-%s, aborting’, but the feature name is spelled incorrectly.

Источник

Оцените статью