Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As I know, .deb package usually includes a control file. Take libfreetype6_2.3.9-5ubuntu0.4_i386.deb for example, its control file includes the following content:

Package: libfreetype6

Source: freetype

Version: 2.3.9-5ubuntu0.4

Architecture: i386

Maintainer: Ubuntu Core Developers

Installed-Size: 704

Depends: libc6 (>= 2.4), zlib1g (>= 1:1.1.4)

Conflicts: freetype, xpdf-reader (<< 1.00-4)

Section: libs


Question 1:

I want to know how to find the information like " Depends: libc6 (>= 2.4), zlib1g (>= 1:1.1.4) " myself. From the configure file, Makefile, README or something else?

Question 2:

Does there exist the tool generating the control file automatically?

I'm so grateful for your answer.

share|improve this question
I'm having some trouble working out exactly what it is you're trying to do here. You have some arbitrary tarball, and you're trying to create your own .deb file from it, and thus need want help in creating your control file, or you have some arbitrary .deb, and you're trying to parse it manually without using the standard Debian tools, and want to extract the embedded control file? – Zed Nov 17 '10 at 16:42
up vote 0 down vote accepted

Assuming its written correctly, this information will be checked by configure, but getting a reliable list usually involves going to that project's home page, README, etc., and reading through the documentation there. Even the most poorly documented projects tend to list this information somewhere. If you can't find it, you can try compiling it with errors, and tracing down what's failing (i.e., missing headers, libraries, etc.).

If you're trying to build your own .deb package, and are looking for something like the automatic dependency resolving found in things like RPMs, you're out of luck. There may be third-party solutions, but I wouldn't rely on them.

Although your original question was a little obscure, your comments make it sound like you're trying to compile (and run) an application yourself. If this is the case, you can use the following command to download any and all build sources associated with the binary package, making it a cinch for you to compile the program from source.

apt-get build-dep <package_name>

Now, compiling your package is as easy as running configure and make.


share|improve this answer
Thanks for your answer, but what do you mean "the automatic dependency resolving found in things like RPMs"? Is there any tool generating the package with dependency informantion in RPM? – user60542 Nov 18 '10 at 8:58
rpmbuild has an automatic dependency requirement step that will actually parse through any binaries and attempt to solve dynamically linked libraries. It then (automatically) adds these to the requirements. Its actually not as useful as you might think; there are a lot of false positives, sometimes the wrong packages are identified, and more. – Andrew M. Nov 18 '10 at 12:47
Debhelper has exactly this feature, which is why the bulk of Debian control files usually have a dependency line that looks like "Depends: ${misc:Depends}, ${shlibs:Depends}" – Zed Nov 19 '10 at 17:17

Dpkg is a simple package installed it doesn't resolve the dependencies. Did you try to install the package by apt-get -f install package_name ?

It was because of dependencies that apt dselect and aptitude ware developed.


share|improve this answer
As far as I know, the command apt-rdepends can list the dependency tree. – user60542 Nov 17 '10 at 9:06
But I want to install some .tar.gz package myself. Because it is not a .deb package, and can not installed by "apt-get install", the corresponding dependency tree can not be build by apt automatically. How can I get the dependency tree under this situation? – user60542 Nov 17 '10 at 9:09

Your Answer


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