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.