When you build some project, you may see the compile error such as:
“zlib.h : No such file or directory.”
Then you need to know which package include zlib.h to install by ‘apt-get’.
I show you how to find this. (Japanese version of this page)
Using apt-file command
At first, install apt-file command and prepare it.
$ sudo apt-get install apt-file $ sudo apt-file update
To find zlib.h,
$ apt-file search zlib.h
It reports too many result. Let’s narrow down.
$ apt-file search /usr/include/zlib.h zlib1g-dev: /usr/include/zlib.h
Now you know zlib.h is in zlib1g-dev package.
$ sudo apt-get install zlib1g-dev
Using ubuntu web service
Later, My friend told me there is much easier way.
Go to http://packages.ubuntu.com/
Use the form of ‘Search the contents of packages’
Yes, it is easier. You don’t need any preparation.