Advanced Packaging Tool
From Wikipedia, the free encyclopedia
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-like operating 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. The Fink project has ported APT to Mac OS X for some of its own package management tasks, and APT is also available in OpenSolaris (included in Nexenta OS distribution). APT is free software, distributed under the GNU General Public License.
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:
- Synaptic Package Manager, a GTK+ graphical user interface
- dselect, an ncurses text interface
- aptitude, a versatile alternative to dselect
- KPackage, part of KDE
- Adept Package Manager, a graphical user interface for KDE
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.[1]
[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 as well. The Debian CDs available for download contain Debian repositories. This allows non-networked machines to be upgraded.
[edit] APT pinning
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 allows administrators to ensure that packages are not upgraded to versions which may conflict with other packages on the system, or that have not been sufficiently tested for unwelcome changes.
In order to do this, the pins in APT's preferences file must be modified,[2] although graphical front-ends often allow this more simply.
[edit] History
The original effort that led to the apt-get program was the dselect replacement project known by its codename 'deity'.[3] This project was commissioned by Brian White the Debian Release Manager at the time. The very first functional version of apt-get was called dpkg-get and was only intended to be a test program for the core library functions that would underpin the new UI.[4]
Much of the original development of APT was done on IRC so records have been lost. The 'Deity Creation Team' mailing list archives include only the major hilights.
The Deity name was abandoned as the official name for the project due to concerns over the religious nature of the name. The APT name was eventually decided after considerable internal and public discussion. Ultimately the name was proposed on IRC, accepted and then finalized on the mailing lists.[5] As originally used APT is not an ancroynm, but a proper name. The name gained mindshare during IRC discussions due to the variety of possible ancronym expansions and it was ultimately decided that the official use of APT would be as a proper name and no official expansion would ever be presented by the team.
APT was introduced in 1998 and original test builds were circulated on IRC. The first Debian version that included it was Debian 2.1, released on 9 March 1999.[6]
In the end the original goal of the Deity project of replacing the dselect UI was a failure. Work on the UI portion of the project was abandoned (the UI directories were CVS rm'd) after the first public release of apt-get. The response to APT as a dselect method and a command line utility was so great and positive that all development efforts focused on maintaining and improving the tool. It wasn't until much later that several independent people built UIs on top of the capable libapt-pkg.
The final push of the first APT era was to build a complete dpkg replacement (libapt-inst). This project was also a failure, however the partial code found a use as part of the secretive 'Project Betsy' programme, which resulted in the highly efficient apt-ftparchive and libapt python bindings. After this the original author faded away and maintainership of APT languished.
Eventually a new team picked up the project, began to build new features and released version 0.6 of APT which introduced the Secure APT feature, using strong cryptographic signing to authenticate the package repositories.[7]
[edit] Easter Egg
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]
# apt-get moo (__) (oo) /------\/ / | || * /\---/\ ~~ ~~ ...."Have you mooed today?"...
[edit] See also
- Wajig - a simplified front end to apt
- alien - a program to convert between different Linux package formats
- RPM Package Manager - package management system developed by Red Hat
- Ports collection - package management system used by BSD
- Portage - package management system used by Gentoo
- Linux Standard Base - a project to standardize Linux distributions, criticized for failing to support apt
[edit] References
- ^ Byfield, Bruce. An apt-get primer. Newsforge.
- ^ Apt Pinning. Debian Wiki. Retrieved on 2006-09-19.
- ^ Deity Mailing List, 1997-04.
- ^ Deity Mailing List, 1998-03.
- ^ Deity Mailing List, 1998-03.
- ^ A Brief History of Debian. Debian.org.
- ^ Secure APT. Debian Wiki. Retrieved on 2006-09-05.