Francais | English | Espanõl

Advanced Packaging Tool

From Wikipedia, the free encyclopedia

Jump to: navigation, search

Advanced Packaging Tool, or APT, is a package management system used by Debian GNU/Linux and its derivatives. APT simplifies the process of managing software on Unix systems, by automating the retrieval, configuration and installation of software packages, either from binary files or by compiling source code. APT was originally designed as a front-end for dpkg to work with Debian's .deb packages, but it has since been modified to work with the RPM Package Manager system via apt-rpm, and the Fink project has ported APT to Mac OS X for some of its own package management tasks.

Contents

[edit] Usage

There is no single "apt" program as such; APT is a C++ library of functions (known as libapt) which are used by front-end programs for dealing with packages. apt-get and apt-cache are simple command line frontends to libapt. They are commonly used in examples due to their simplicity and ubiquity; apt-get and apt-cache are of important priority in all current Debian releases, and are therefore installed in a default Debian installation. Several other front-ends to APT exist, which provide more advanced installation functions and more intuitive interfaces. These include:

APT front-ends can:

  • Search for new packages;
  • Upgrade packages;
  • Install or remove packages;
  • Upgrade the whole system to a new release.

APT front-ends can list the dependencies of packages being installed or upgraded, 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 such as removing obsolete files and packages.

APT is often hailed as one of Debian's best features.<ref>Byfield, Bruce. An apt-get primer. Newsforge.</ref>

[edit] Sample usage of apt-get

Using apt-get, the following output might be obtained when installing the Mozilla Application 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) ...

Other than install, the other most used apt-get commands are apt-get update, apt-get upgrade and apt-get dist-upgrade.

[edit] Sources

APT relies on the concept of "repositories" in order to find software and resolve dependencies. A repository is a directory containing packages along with an index file. 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 APT's sources.list configuration file 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, Compact Discs 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.

[edit] APT pinning

Image:Wiki letter w.svg Please expand this section.
Further information might be found on the talk page or at Requests for expansion.
Please remove this message once the section has been expanded.

APT pinning is a feature which allows administrators to force APT to choose particular versions of packages which may be available in different versions from different repositories. This might be required if, for example, upgrading to more recent versions of the package are expected to create problems, or if you need to downgrade a package.

In order to do this, the pins in APT's preferences file must be modified,<ref>Apt Pinning. Debian Wiki. Retrieved on 2006-09-19.</ref> although graphical front-ends often allow this more simply.

[edit] History

Image:Wiki letter w.svg Please expand this section.
Further information might be found on the talk page or at Requests for expansion.
Please remove this message once the section has been expanded.

APT was introduced in 1998. The first Debian version that included it was Debian 2.1, released on 9 March 1999.<ref>A Brief History of Debian. Debian.org.</ref>

Version 0.6 of APT introduced the Secure APT feature, which uses strong cryptographic signing to authenticate the package repositories.<ref>Secure APT. Debian Wiki. Retrieved on 2006-09-05.</ref>

[edit] Trivia

In its help message, apt-get displays the message "This APT has Super Cow Powers." This message is a hint of an Easter egg; the command "apt-get moo" displays an ASCII art image of a cow, and the text "Have you mooed today?". This Easter egg is expanded upon by some APT frontends, and the depiction of the ASCII cow itself is sometimes modified by distribution vendors.[citation needed]

[edit] See also

</div>

[edit] References

<references />

bg:Apt

ca:Apt-get de:Advanced Packaging Tool es:Advanced Packaging Tool eu:Advanced Packaging Tool fr:Advanced Packaging Tool gl:APT it:Advanced Packaging Tool nl:Advanced Packaging Tool ja:APT pl:APT pt:Advanced Packaging Tool tr:APT zh:Debian Apt

Personal tools