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
🌐
CMake Discourse
discourse.cmake.org › usage
Can't find ZLIB (missing: ZLIB_LIBRARY) Ubuntu 20 CMake - Usage - CMake Discourse
January 23, 2021 - 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 ZLIB_INCLUDE_DIR=/urs/local/zlib/include But still receive a not found a error. Someone said on the internet, there ...
Discussions

ubuntu 18.04 - Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.11") - Stack Overflow
I'm trying to install the tool shmutzi on Ubuntu 18.04.2. I've cloned it from git, installed all the dependencies (except zlib, which apt install doesn't find and I understand is included in zlib1g... More on stackoverflow.com
🌐 stackoverflow.com
February 28, 2019
[Documentation Improvement] CMake error: Could not Find ZLIB error while using make
CMake error: Could not Find ZLIB error while using make After the use of make command (while configuring and building vw), CMake error propped up with the following message: CMake Error at /usr/sha... More on github.com
🌐 github.com
8
February 28, 2020
ubuntu 14.04 - No zlib.h file in usr/local/include how to get it - Stack Overflow
Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... I’m Jody, the Chief Product and Technology Officer at Stack Overflow. Let’s... Release notes and bug fixes for beta.stackoverflow.com · 2 Android NDK - fatal error: zlib.h: No such file or directory · 1 How to keep g++ from taking header file from /usr/include? 8 Could ... More on stackoverflow.com
🌐 stackoverflow.com
zlib not found, but installed
# 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 c... More on github.com
🌐 github.com
4
November 16, 2015
🌐
It's FOSS
itsfoss.com › install-zlib-ubuntu
How to Install Zlib on Ubuntu Linux [Easily]
February 14, 2023 - Done E: Unable to locate package zlib · 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 ...
🌐
Stack Overflow
stackoverflow.com › questions › 54923690 › could-not-find-zlib-missing-zlib-library-found-version-1-2-11
ubuntu 18.04 - Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.11") - Stack Overflow
February 28, 2019 - You can install zlib via sudo apt install zlib1g-dev. ... Sign up to request clarification or add additional context in comments. ... Find the answer to your question by asking.
🌐
GitHub
github.com › VowpalWabbit › vowpal_wabbit › issues › 2298
[Documentation Improvement] CMake error: Could not Find ZLIB error while using make · Issue #2298 · VowpalWabbit/vowpal_wabbit
February 28, 2020 - This error can originate in two cases: i) Either the zlib module itself is not installed or ii) This is a multilib issue and when zlib1g-dev:i386 is installed then the make commands run successfully.
Author   VowpalWabbit
🌐
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 - I *think* that what worked for me in the end was to configure and install the older zlib into /usr/local and then run sudo ./lscsoft-install-x.sh --from-tar=/opt/lscsoft and then configure and make lalsuite I originally tried to install zlib to /opt/lscsoft/non-lsc since it seemed like the 'right' place to put it, but no matter what I did with configure parameters (e.g. --with-zlib=/opt/lscsoft/non-lsc) or PKG_CONFIG_PATH got ignored (at least by the lscsoft-install-x.sh script - I didn't try it for lalsuite because I couldn't get past that) ... No luck yet. I tried your suggestions, but I'm s
Find elsewhere
🌐
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
🌐
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 ...
🌐
GitHub
github.com › netdata › netdata › issues › 24
zlib not found, but installed · Issue #24 · netdata/netdata
November 16, 2015 - PTHREAD_CREATE_JOINABLE checking ... were not met: No package 'zlib' found Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix....
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.
🌐
GoLinuxCloud
golinuxcloud.com › home › how to install zlib on ubuntu
Install zlib on Ubuntu: zlib1g, zlib1g-dev, pkg-config, and Source Build
January 7, 2024 - Install zlib on Ubuntu with sudo apt install zlib1g-dev for headers and pkg-config, fix configure could not find the zlib library and zlib.h not found errors, verify with pkg-config --modversion zlib, and optionally build zlib 1.3.1 from source.
🌐
Reddit
reddit.com › r/linuxquestions › cmake not finding zlib
r/linuxquestions on Reddit: Cmake not finding zlib
February 28, 2019 -

Hello,

I'm trying to make a tool, but I'm getting this error:

CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.11")

I have installed zlib using

sudo apt install zlib1g-dev

, and zlib.h is located in /usr/include/, which was suggested in other threads with this problem, but it didn't help. What else can I do?

I've installed the same tool on another computer without problems, so it's not the tool.

🌐
Learn Ubuntu
learnubuntu.com › install-zlib
Install zlib on Ubuntu
February 21, 2023 - It does not mean that zlib is not available in the default repository but the package name is quite different. As I mentioned earlier, you must use the correct package name for the installation. ... Similarly, there is another package intended for development purposes. Unless you know what you are doing, the mainline package (zlib1g) will do just fine.
🌐
GitHub
github.com › aseprite › aseprite › issues › 857
Could not build on Ubuntu 15.04 · Issue #857 · aseprite/aseprite
November 9, 2015 - Could not build on Ubuntu 15.04#857 · Copy link · Labels · compilationlinux · TeddyDD · opened · on Nov 9, 2015 · Issue body actions · While using cmake .. -G "Unix Makefiles" on v1.1.1 tag I got this errors: -- Could NOT find ZLIB (missing: ZLIB_INCLUDE_DIR) -- Found BZip2: /usr/lib/x86_64-linux-gnu/libbz2.so (found version "1.0.6") -- Looking for BZ2_bzCompressInit -- Looking for BZ2_bzCompressInit - found -- Could NOT find ZLIB (missing: ZLIB_INCLUDE_DIR) -- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR) -- Checking for module 'harfbuzz>=0.9.7' -- Found harfbuzz, vers
Author   aseprite