Install 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.

Читайте также:  Компьютер сам перезагружается windows 10 kernel power 41

Источник

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.

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

Читайте также:  Windows 10 как включить автозапуск съемных носителей

If you have installed Python but get this error

configure Python with

Finally run make command to generate the Python binaries.

Источник

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

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 zlib on linux

Библиотека сайта rus-linux.net

На главную -> MyLDP -> Электронные книги по ОС Linux

Linux From Scratch (version 6.8)
Назад Глава 6. Установка программ базовой системы Вперед

6.11. Пакет Zlib-1.2.5

В пакете Zlib находятся подпрограммы сжатия и распаковки, используемые некоторыми программами.

Читайте также:  Где vst плагины mac os

Приблизительное время сборки: менее 0,1 SBU

Требуемое дисковое пространство: 2,8 MB

6.11.1. Установка пакета Zlib

Сначала исправьте опечатку в заголовочном файле пакета:

Подготовьте пакет Zlib для компиляции:

Пояснение новой конфигурационной переменной среды окружения:

Значение переменной CFLAGS переопределит настройки, используемые в пакете по умолчанию для оптимизации, и позволит предотвратить некоторые ошибки времени исполнения. Обратите внимание, что флаг -mstackrealign может приводить к проблемам при сборке систем, отличных по архитектуре от Intel.

Чтобы проверить результаты, наберите:

Совместно используемые библиотеки необходимо перенести в директорий /lib , в результате чего потребуется пересоздать файл .so , находящийся в директории /usr/lib :

6.11.2. Описание пакета Zlib

Установленные библиотеки: libz.

Содержит функции сжатия и распаковки, используемые некоторыми программами

Источник

Install zlib on linux

zlib is a general-purpose, free, open source and legally unencumbered library software that provides support for lossless data-compression using the portable zip archive file format. It can be used on any operating system or computer hardware.

The library is designed to minimize memory allocation, while compressing archives with up to 20% faster than other similar formats, with a crc32 error-detecting code of about 50% faster. Supports decode and encode of gzip streams, and much more.

Getting started with zlib

Installing zlib on your GNU/Linux machine is an easy task that can be achieved even by those who just started using a Linux kernel-based operating systems. All you have to do, is to download the latest version of zlib from Softpedia or via its official website (see link at the end of the article), save the archive somewhere on your computer and extract its contents with an archive manager software.

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). 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.

That’s it, zlib is no installed on your computer and can be easily integrated into an application to handle zip archives (compress and decompress). When installed, the respective app will require the zlib library.

A portable library, supported on all mainstream OSes

Being highly portable, the zlib library can be used on any modern, mainstream Linux and UNIX-like operating system, including GNU/Linux, BSD (FreeBSD, OpenBSD, NetBSD), Solaris, Microsoft Windows and Mac OS X. Currently, it can be installed on 64-bit and 32-bit computers. The project is distributed as part of the well-known libpng library software.

Источник

Оцените статью
CFLAGS=’-mstackrealign -fPIC -O3′