= What Is A Package = A Debian package consists of both its contents (generally, the files and directories it includes) and some metadata. There are both source and binary packages, which we will discuss in detail. Binary packages have the file extension `.deb`, and are managed with the `dpkg` command. Given a .deb file, `dpkg -c` will list the files in the package, and `dpkg -I` will display the package's "control" information. This is the metadata mentioned above. Let's look at an example: {{{ $ dpkg -I xterm_271-1ubuntu2.1_amd64.deb new debian package, version 2.0. size 565320 bytes: control archive= 8406 bytes. 198 bytes, 6 lines conffiles 1690 bytes, 35 lines control 2031 bytes, 31 lines md5sums 22146 bytes, 665 lines * postinst #!/bin/sh 160 bytes, 5 lines * postrm #!/bin/sh 21414 bytes, 647 lines * prerm #!/bin/sh Package: xterm Version: 271-1ubuntu2.1 Architecture: amd64 Maintainer: Ubuntu X-SWAT Installed-Size: 1382 Depends: xbitmaps, libc6 (>= 2.15), libfontconfig1 (>= 2.8.0), libice6 (>= 1:1.0.0), libtinfo5, libutempter0 (>= 1.1.5), libx11-6, libxaw7, libxft2 (>> 2.1.1), libxmu6, libxt6 Recommends: x11-utils Suggests: xfonts-cyrillic Provides: x-terminal-emulator Section: x11 Priority: optional Multi-Arch: foreign Homepage: http://invisible-island.net/xterm/xterm.html Description: X terminal emulator xterm is a terminal emulator for the X Window System. It provides DEC VT102 and Tektronix 4014 compatible terminals for programs that cannot use the }}} (The description has been truncated for brevity). The first line tells us what version of the Debian package format this package uses. Then comes the size of the package itself and the "control archive" (metadata). The "control archive" contains several files such as `conffiles`, `control`, `md5sums`, `postinst`, `postrm`, `prerm`. `conffiles` is a list of files that Debian package system believes to be configuration files, intended to be customized by the user. The packaging system will not automatically replace these files on upgrade if the user has made changes to them. We'll talk more about conffiles later. The `md5sums` file contains MD5 checksums and helps verify package integrity, both while installing the file, and later on to determine if files have been changed after installation. The `postinst`, `postrm`, and `prerm` files are what are called "maintainer scripts". We will talk more about those later, but for now, they are scripts that are run after installation (postinst), after removal (postrm) and before removal (prerm). The remainder of the output is the `control` file itself, which has a number of fields. - Package and Version should be self-explanatory - Architecture is the specific processor architecture for which this package was built. There is also the architecture "all", meaning that it's architecture independent, as it does not use any compiled software. - Depends is a comma-separated list of packages which must be installed prior to installation of this package. The parenthetical portions specify a specific version for the preceeding package. For example, this package requires any version of the 'xbitmaps' package, but requires version 2.15 or later of the 'libc' package. - Recommends is a list of packages that should be installed, but aren't firm requirements. - Suggests is even more lax than Recommends, and is generally not used by any package managers. - Description: is a description of the package. The first line should be a summary, and subsequent lines should be a full-text description, indented by one space.