In Ubuntu repository, when an application or library depend on some others, installing via apt-get will automatically download and install the dependencies first. Does this way install from binary installation files such as .deb?

When install an application or library by building their source code, ./configure will tell which dependencies are missing and I will manually install them first.

When install an application from running its .deb file downloaded from websites such as Ubuntu ppa, I don't remember I have to handle dependencies. Does a .deb file contain the dependencies in its content, or does it automatically download and install the dependencies?

3 Answers 3


When you get the list of packages from a repository via apt-get update, both in /var/lib/apt and /var/lib/dpkg you'll find information for all packages in the form

Package: apt
Priority: important
Section: admin
Installed-Size: 3462
Maintainer: APT Development Team <deity@lists.debian.org>
Architecture: i386
Version: 1.3.1
Replaces: apt-utils (<< 1.3~exp2~)
Depends: adduser, gpgv | gpgv2 | gpgv1, debian-archive-keyring, init-system-helpers (>= 1.18~), libapt-pkg5.0 (>= 1.3~rc2), libc6 (>= 2.15), libgcc1 (>= 1:4.2), libstdc++6 (>= 5.2)
Recommends: gnupg | gnupg2 | gnupg1
Suggests: apt-doc, aptitude | synaptic | wajig, dpkg-dev (>= 1.17.2), powermgmt-base, python-apt
Breaks: apt-utils (<< 1.3~exp2~)
Filename: pool/main/a/apt/apt_1.3.1_i386.deb
Size: 1208426
MD5sum: 9d35afa0f8220cabf0c837f8073569c2
Description: commandline package manager
Description-md5: 9fb97a88cb7383934ef963352b53b4a7
Tag: admin::package-management, devel::lang:ruby, hardware::storage,
 hardware::storage:cd, implemented-in::c++, implemented-in::perl,
 implemented-in::ruby, interface::commandline, network::client,
 protocol::ftp, protocol::http, protocol::ipv6, role::program,
 scope::application, scope::utility, sound::player, suite::debian,
 use::downloading, use::organizing, use::searching, works-with::audio,
 works-with::software:package, works-with::text
SHA256: 9111e4e9ffe3f3dd3c62c4e67485d3495c15bf5d24f4f1c532db4430b389eb19

This information is also present as the file debian/control in each .deb package. As you can see, it contains a Depends: ... line that list all dependencies. From these dependencies apt-get calculates recursively all packages which need to be installed.

When a package is created, this information is added by the package maintainer (though there are some tools to help with this), similarly to how you manually add packages when you compile it yourself.


The person who packaged the .deb file in the first place followed a procedure similar to what you describe for manual installation. When they did that (if they did their work correctly) they also added information about the required dependencies in the source package's debian/control file.

apt-get and other dpkg front ends indeed operate solely on .deb packages and the associated package database with metainformation about these packages. Sometimes you want to create a .deb package of locally produced software just so that the entire chain will work correctly, and you get the benefit of automatic dependency installation etc.


When you try to install (using dpkg -i) some *.deb package with a missing (unsatisfied) dependency, you get an error message mentionning the missing packages. You can then apt-get install or aptitude install these missing packages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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