You need to install -dev package for zlib1g - it is named zlib1g-dev:

sudo apt-get install zlib1g-dev

and it will install zlib.pc file for pkg-config along with zlib.h header.

Answer from N0rbert on askubuntu.com
🌐
It's FOSS
itsfoss.com › install-zlib-ubuntu
How to Install Zlib on Ubuntu Linux [Easily]
February 14, 2023 - But here comes the problem. If you try installing Zlib on Ubuntu, it will throw “unable to locate package zlib” error.
🌐
GitHub
github.com › netdata › netdata › issues › 24
zlib not found, but installed · Issue #24 · netdata/netdata
November 16, 2015 - # apt-get install zlib1g-dev Reading package lists... Done Building dependency tree Reading state information... Done zlib1g-dev is already the newest version. $ ./configure --prefix=/opt/netdata checking for a BSD-compatible install... ...
Author   netdata
🌐
SysTutorials
systutorials.com › installing-zlib-in-ubuntu-22-04
Installing Zlib On Ubuntu 24.04 And 22.04 LTS - SysTutorials
April 12, 2026 - If you’ve hit a “zlib.h: No such file or directory” error during compilation, this is what you need. ... That’s it. On a fresh Ubuntu server, this should be one of your first installations if you plan to compile anything. ... If you only need the runtime library (not development), zlib1g is sufficient.
🌐
CMake Discourse
discourse.cmake.org › usage
Can't find ZLIB (missing: ZLIB_LIBRARY) Ubuntu 20 CMake - Usage - CMake Discourse
January 23, 2021 - I am compiling github’s OpenROAD. Following the instructions. github clone cd OpenROAD mkdir build, and cmake … The cmake checks, proceeds and stops, with an error ‘Could NOT find ZLIB’ I have issued the command, within Ubuntu version 20: export ZLIB_LIBRARY=/usr/local/zlib/lib export ...
🌐
Ask Ubuntu
askubuntu.com › questions › tagged › zlib
Newest 'zlib' Questions - Ask Ubuntu
I am an Ubuntu newbie and would like to install zlib1g-dev on Ubuntu 16.04.3 LTS. The command: sudo apt-get install zlib1g-dev ressults in the following error: Reading package lists... Done ... ... I get this error message: Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (...
Find elsewhere
🌐
TREND OCEANS
trendoceans.com › home › blog › topic › troubleshoot › how to solve zipimport.zipimporterror: can’t decompress data; zlib not available
How to Solve Zipimport.ZipImportError: Can't Decompress Data; Zlib Not Available - TREND OCEANS
June 19, 2023 - It throws the error “Zipimport.ZipImportError: can’t decompress data; zlib not available.” · This issue mostly occurs when Zlib is not installed on your system. We can easily fix this issue with the required dependencies.
🌐
LinuxCapable
linuxcapable.com › home › ubuntu › how to install zlib on ubuntu 26.04, 24.04 and 22.04
How to Install zlib on Ubuntu 26.04, 24.04 and 22.04 - LinuxCapable
May 5, 2026 - If you searched for libz, that is the linker/library name rather than the package to install. zlib-devel is a Red Hat-family package name, zlib-dev is not an Ubuntu package, libz-dev has no Ubuntu candidate in the supported LTS releases, and python3-zlib is not needed for normal Python because Python’s zlib module is already available with the interpreter.
🌐
SysTutorials
systutorials.com › how-to-install-the-zlib-library-in-ubuntu
Building Zlib From Source On Ubuntu - SysTutorials
April 11, 2026 - If both system zlib and a custom build are installed, they typically coexist without issues — the dynamic linker prioritizes /usr/local/lib over /usr/lib by default. To verify which library your program uses: ... If you need strict version control, use separate prefixes and manage LD_LIBRARY_PATH or PKG_CONFIG_PATH carefully per project. Thanks!!! This help me so much!! ... i believe you have to install “build-essential” if not you need to install “make” sudo apt install build-essential
🌐
Stack Exchange
unix.stackexchange.com › questions › 759174 › zlib-not-available-error-in-spite-of-the-package-already-installed
linux mint - zlib not available error in spite of the package already installed - Unix & Linux Stack Exchange
October 17, 2023 - I am trying to install pip through - python3 get-pip.py but it is giving zlib not available error. I have tried following commands - sudo apt install zlib1g-dev [OUTPUT: zlib1g-dev is already the
🌐
GitHub
github.com › pyenv › pyenv › issues › 1252
pyenv install 3.6.4 error ubuntu18 · Issue #1252 · pyenv/pyenv
December 5, 2018 - Last 10 log lines: sys.exit(en...3.6.4/Lib/ensurepip/init.py", line 27, in _run_pip import pip zipimport.ZipImportError: can't decompress data; zlib not available Makefile:1099: recipe for target 'install' failed make: *** [install] Error 1...
Author   pyenv
🌐
Linux Compatible
linuxcompatible.org › story › how-to-install-zlib-on-ubuntu-2204-or-2004
How to Install zlib on Ubuntu 22.04 or 20.04
January 15, 2023 - The guide walks you through fixing missing zlib.h and gzopen errors on Ubuntu 22.04 or 20.04 by first checking if the runtime library is already installed. If it isn’t, you run apt update and install zlib1g, then pull in libz-dev so your compiler ...
🌐
Ubuntu Forums
ubuntuforums.org › archive › index.php › t-2217198.html
[SOLVED] problem: configure could not find the zlib library [Archive] - Ubuntu Forums
April 16, 2014 - Lastly I did the following: cd ~/src git clone git@repository.location:lalsuite.git ~/src/lalsuite cd lalsuite ./00boot && ./configure --prefix=/opt/lscsoft --disable-laldetchar && make -j4 install Again, it's during the configure where the compile fails. If it doesn't fail on zlib, it will fail on lalframe and metaio in sequence.
🌐
Learn Ubuntu
learnubuntu.com › install-zlib
Install zlib on Ubuntu
February 21, 2023 - Here's how you can get zlib on Ubuntu Linux. ... The zlib is not a typical package but a software library used for data compression. And if you are not aware, the gzip utility uses the zlib library for the data compression. But if you'd try to perform the straightforward installation with apt, you will get the following error: It does not mean that zlib is not available in the default repository but the package name is quite different.