Advanced Packaging Tool

From Free net encyclopedia

Advanced Packaging Tool, or APT, is a package management system used by Debian and its derivatives. APT was originally designed to work with .deb packages on Debian systems, but it has since been modified to work with RPM packages via apt-rpm, and to run on other operating systems such as Mac OS X (see fink). On systems with package management based on .deb, such as Debian, APT is a front-end for dpkg.

APT simplifies the process of installing and removing software on Unix systems, by automating the retrieval, (from the Internet, local network, or CD) the configuration, the compiling (sometimes) and the installation of software from APT sources.

There is no apt program per se; APT is a [[C++]] library of functions that are used by several command line programs for dealing with packages, most notably apt-get and apt-cache.

APT front-ends can upgrade the system or specific packages. Packages can be installed or removed. When installing one or several packages, APT front-ends can list the dependencies of these packages, ask the administrator if packages recommended or suggested by newly installed packages should be installed too, automatically install dependencies and perform other operations on the system's packages to allow the installation of the packages. Similarly, to update one or several packages, front-ends can install, remove or update other packages.

APT is often hailed as one of Debian's best features, giving Debian the reputation of being a "pain to install, but a joy to maintain", although with Debian 3.1 and its Debian-Installer, Debian's installation might be too easy nowadays to keep this true.

Contents

Sources

The Debian project keeps a central repository of over 17,000 software packages ready for download and installation. For extra packages, any number of additional repositories can be added to /etc/apt/sources.list and then be queried by APT. Problems may appear when several sources offer the same package(s). Systems that have such possibly conflicting sources can use APT pinning to control which sources should be preferred. Once a package repository has been specified (like during the system installation), packages in that repository can be installed without specifying a source.

In addition to network repositories, CDs and other storage media can be used too. The Debian CDs available for download contain Debian repositories. This allows non-networked machines to be upgraded. There are also programs that provide a front end to APT, such as Synaptic with a [[GTK+]] graphical user interface and aptitude with an ncurses text interface.

APT pinning

APT pinning is a way for administrators to make Debian GNU/Linux's version of APT to grab particular packages from different distributions, using it with more than two of the Debian release sources: stable, testing, and unstable. In order to do this, the pins in the /etc/apt/preferences file must be modified. [1]

apt-get

apt-get is a program part of the apt package used as a simple command line tool to libapt. Nevertheless, partly due to the quick way it provides to manage packages, it is probably still the most used APT front-end.

For example, the following output might be obtained when installing the Mozilla Application Suite suite (packaged in the mozilla meta package):

# apt-get install mozilla
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
  libnss3 mozilla-mailnews mozilla-psm
Suggested packages:
  mozilla-chatzilla
Recommended packages:
  myspell-en-us myspell-dictionary
The following NEW packages will be installed:
  libnss3 mozilla mozilla-mailnews mozilla-psm
0 upgraded, 4 newly installed, 0 to remove and 3 not upgraded.
Need to get 2658kB of archives.
After unpacking 7991kB of additional disk space will be used.
Do you want to continue? [Y/n]

APT searches its cached list of packages and lists dependent packages (dependencies) it needs to install or upgrade. After confirmation:

Get:1 http://gulus.usherbrooke.ca testing/main libnss3 2:1.7.8-1 [654kB]
Get:2 http://gulus.usherbrooke.ca testing/main mozilla-mailnews 2:1.7.8-1 [1811kB]
Get:3 http://gulus.usherbrooke.ca testing/main mozilla-psm 2:1.7.8-1 [192kB]
Get:4 http://gulus.usherbrooke.ca testing/main mozilla 2:1.7.8-1 [1022B]
Fetched 2658kB in 14s (177kB/s)
Reading package fields... Done
Reading package status... Done
Selecting previously deselected package libnss3.
(Reading database ... 62277 files and directories currently installed.)
Unpacking libnss3 (from .../libnss3_2%3a1.7.8-1_i386.deb) ...
Selecting previously deselected package mozilla-mailnews.
Unpacking mozilla-mailnews (from .../mozilla-mailnews_2%3a1.7.8-1_i386.deb) ...
Selecting previously deselected package mozilla-psm.
Unpacking mozilla-psm (from .../mozilla-psm_2%3a1.7.8-1_i386.deb) ...
Selecting previously deselected package mozilla.
Unpacking mozilla (from .../mozilla_2%3a1.7.8-1_i386.deb) ...
Setting up libnss3 (1.7.8-1) ...

Setting up mozilla-mailnews (1.7.8-1) ...
Updating mozilla chrome registry...done.

Setting up mozilla-psm (1.7.8-1) ...
Updating mozilla chrome registry...done.

Setting up mozilla (1.7.8-1) ...

APT automatically fetches, configures and installs the dependencies. The other most used apt-get commands are "apt-get update", "apt-get upgrade" and "apt-get dist-upgrade" (the two last ones having a similar use).

See also

Template:Portalpar

External links

ca:Apt-get de:Advanced Package Tool es:APT fr:Advanced Packaging Tool it:Advanced Packaging Tool nl:Advanced Packaging Tool pl:APT pt:Advanced Packaging Tool zh:Debian Apt