Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need a few header file namely curses.h for text based programming Please tell me how to install these header files.

share|improve this question

2 Answers 2

up vote 17 down vote accepted

You can install libncurses5-dev package via Software Center or:

sudo apt-get install libncurses5-dev

Also, you can install the package by clicking here.

When you need a file or package and can't find it you can use some tools.

1. apt-file

First, install apt-file and update it.

sudo apt-get install apt-file
apt-file update

You can search with apt-file needed files or packages.

apt-file search curses.h

2. Use packages.ubuntu.com

Go to this link.

On right top, select package contents if your are searching a file included with a package. If you need a package directly, just search it with its name choosing package names.

share|improve this answer
can you tell me what libncurses package contains? –  coder Nov 13 '11 at 8:49
please tell me how to get gtk.h –  coder Nov 13 '11 at 8:50
@sharik, I edited my answer. Finding packages could be tricky, since when you search those files you can get lots of package names. You must know what you are looking for. Probably you need libgtk2.0-dev or libgtk-3-dev now. But, since you are using 11.10 first choose libgtk-3-dev one. If you have more questions, just edit your question to widen it. Do not ask one by one in your comments. –  heartsmagic Nov 13 '11 at 9:10
Holy crap I can't believe I have never heard of apt-file after using it for all these years. Thanks for the tip, awesome! –  xamox Feb 20 at 5:46

Find package from file

Edit: This only works for an installed package, so is not able to answer the question. Better is heartmagic's answer

To find out what package a file is part of, you can use

dpkg -S <file name>

For example, dpkg -S curses.h gives me this output:

libncurses5-dev: /usr/include/ncurses.h
libncurses5-dev: /usr/include/curses.h

Find files in package

Edit: You need to have the package installed for this to work.

To get the list of files provided by a package, use

 dpkg -L <package name>

For example dpkg -L libncurses5-dev gives me the following output


This includes directories as well.

Find ONLY files (not directories) in package

To get just the files the package contains:

dpkg -L libncurses5-dev | while read file; do if [[ -f $file ]]; then echo ${file}; fi; done

(Description: Get the provided files, and for each one, only print it if it is a file.)

More information

You might find this table useful. Just look at the first column (action) and third column (deb) to get a good overview of what you can do. (unless you are curious of course, then look at the other columns.)

share|improve this answer
This is a good info. But there is a small problem for this question. Since libncurses5-dev package is not installed and there is no curses.h on his system, he can't use to find the real package what provides this. But, besides that this is a good info. –  heartsmagic Nov 13 '11 at 18:54
@heartsmagic Thanks for pointing that out. I guess I have investigated Contents-i386,etc. (like in mirror.aarnet.edu.au/pub/ubuntu/archive/dists/oneiric ) and thought that it would use that, but actually it does not. –  Portablejim Nov 13 '11 at 21:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.