wiki:DebianPackagingOverview

Version 3 (modified by jdreed, 11 years ago) (diff)

--

Debian Packaging Overview

A package is used to distribute software and/or metadata to various workstations. In some cases, the entire operating system is installed from a base set of packages -- in other cases, packages are only used to distribute add-on software. Common packages you may have encountered on other operating systems:

  • Windows: a directory containing a setup.exe file, or a Microsoft Installer package (e.g. kfw-4.0.1-i386-mit.msi)
  • Mac OS X: a .pkg file (or a .mpkg file, which in turn contains multiple .pkgs), such as MIT Kerberos Extras.mpkg
  • Red Hat or Fedora Linux: a .rpm file, e.g. TIVsm-API.i386.rpm

For Debian-based distributions (including Ubuntu), the package format is a "Debian package", with a file extension of .deb. These files can be installed with the dpkg command, e.g. dpkg -i some-awesome-software-1.0_amd64.deb.

APT

The dpkg command and .deb files might not be familiar to many Debian and Ubuntu users -- instead, you may be used to installing packages via the apt-get or aptitude commands, or with the Synaptic graphical interface. The Advanced Packaging Tool (APT) is mostly commonly used to install packages from repositories. These repositories contain the actual .deb files, but you rarely interact with them directly. Instead you use a front-end tool like apt-get and request the name of the package, and the tool determines which repositories contain the package, what the current version is, which architecture to use, and download and install it for you.

Useful Commands

  • dpkg -i foo.deb - install a binary package
  • apt-get install package - install package from an apt repository.
  • apt-cache search keywords - Display a list of packages whose names or descriptions match keywords.
  • aptitude search ~Dpackage - List all packages in Debian that Depends: package. Other searches are possible as well: aptitude search ~DRecommends:package finds packages that Recommends: package.
  • dpkg -l [package] - List packages installed on the system, and their version numbers. If package is provided, only list information for package.
  • dpkg -L package - List the files in installed package package.
  • dpkg -S filename - List installed packages that contain filename.
  • apt-file search filename - List all packages in Debian that contain filename. This command is slow.

Next: DissectingAPackage