Advanced Packaging Tool
Encyclopedia
The Advanced Packaging Tool, or APT, is a free
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...

 user interface that works with core libraries to handle the installation and removal of software on the Debian
Debian
Debian is a computer operating system composed of software packages released as free and open source software primarily under the GNU General Public License along with other free software licenses. Debian GNU/Linux, which includes the GNU OS tools and Linux kernel, is a popular and influential...

 GNU/Linux distribution and its variants. APT simplifies the process of managing software on Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 computer systems by automating the retrieval, configuration and installation of software packages
Software package (installation)
In package management systems, which are commonly used with Linux-based operating systems, a package is a specific piece of software which the system can install and uninstall....

, either from binary files or by compiling source code.

APT was originally designed as a front-end for dpkg
Dpkg
dpkg is the software at the base of the Debian package management system. dpkg is used to install, remove, and provide information about .deb packages....

 to work with Debian's .deb
Deb (file format)
deb is the extension of the Debian software package format and the most often used name for such binary packages. Like the "Deb" part of the term Debian, it originates from the name of Debra, erstwhile girlfriend and now ex-wife of Debian's founder Ian Murdock.Debian packages are also used in...

packages, but it has since been modified to also work with the RPM Package Manager
RPM Package Manager
RPM Package Manager is a package management system. The name RPM variously refers to the .rpm file format, files in this format, software packaged in such files, and the package manager itself...

 system via apt-rpm
Apt-rpm
APT-RPM is a version of the Advanced Packaging Tool modified to work with the RPM Package Manager. It was originally ported to RPM by Alfredo Kojima and then further developed and improved by Gustavo Niemeyer, both working for the Conectiva Linux distribution at the time.In March 2005 the...

. The Fink
Fink
The Fink project is an effort to port and package open-source Unix programs to Mac OS X. Fink uses dpkg and APT , as well as its own frontend program, fink ....

 project has ported APT to Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

 for some of its own package management tasks, and APT is also available in OpenSolaris
OpenSolaris
OpenSolaris was an open source computer operating system based on Solaris created by Sun Microsystems. It was also the name of the project initiated by Sun to build a developer and user community around the software...

 (included in the Nexenta OS
Nexenta OS
Nexenta OS, officially known as the Nexenta Core Platform, is a computer operating system based on OpenSolaris and Ubuntu that runs on IA-32- and x86-64-based systems. It emerged in fall 2005, after Sun Microsystems started the OpenSolaris project in June of that year. Version 1.0 was released in...

 distribution).
Cydia
Cydia
Cydia is a large genus of tortrix moths, belonging to the tribe Grapholitini of subfamily Olethreutinae. Its distinctness from and delimitation versus the tribe's type genus Grapholita requires further study....

 is a package manager for jailbroken iOS partially based on APT (ported to iOS as part of the related Telesphoreo project).

Usage

There is no single "apt" program; apt is itself the package name containing the set of tools (and requiring the libraries) that support its functionality. A significant part of apt is a C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

 library of functions (another package known as libapt) which are used by these related front-end programs for dealing with packages, such as apt-get and apt-cache. 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. Apt can be functionally considered to be a front-end to dpkg
Dpkg
dpkg is the software at the base of the Debian package management system. dpkg is used to install, remove, and provide information about .deb packages....

, and a friendlier front end to this than dselect
Dselect
dselect is a computer program used to manage software packages in the Debian operating system.dselect is one of the oldest front-ends to dpkg, and the bulk of its development happened when it was originally written by Ian Jackson, who wrote it alongside dpkg....

. While dpkg performs actions on individual packages, apt tools manage relations (especially dependencies) between them, as well as sourcing and management of higher-level versioning decisions (release tracking and version pinning).

APT is often hailed as one of Debian's best features. It is remarked that this quality comes from the strict quality controls of Debian policy.

A major feature in APT is the way it calls dpkg — it does topological sorting
Topological sorting
In computer science, a topological sort or topological ordering of a directed graph is a linear ordering of its vertices such that, for every edge uv, u comes before v in the ordering...

 of the list of packages to be installed or removed and calls dpkg in the best possible sequence. In some cases, it utilizes the --force options in dpkg. However, it only does this when it is unable to calculate how to avoid the reason dpkg requires the action to be forced.

The most used apt-get commands are apt-get install package-name (frequently the package-name is simply the name of the desired executable application), apt-get update, apt-get upgrade and apt-get dist-upgrade.

Installation of software

An install directive is followed by the name of one or more packages desired for installation. Each package name is phrased as just the name portion of the package, not a fully qualified filename (for instance, in a Debian GNU/Linux system, libc6 would be the argument provided, not libc6_1.9.6-2.deb). Notably, all packages containing dependencies required by the package(s) specified for installation will also be automatically retrieved and installed. This was an original distinguishing characteristic of apt-based package management systems whereby software installation failure due to missing dependencies, a type of dependency hell
Dependency hell
Dependency hell is a colloquial term for the frustration of some software users who have installed software packages which have dependencies on specific versions of other software packages. This was mainly attributable to old Linux package managers...

, was specifically avoided.

Another such distinction is remote repository retrieval of packages. A location configuration file (/etc/apt/sources.list) is used to locate the desired packages and retrieve them, and also obtain information about available (but uninstalled) packages.

Other command option features (switches) may be used to override decisions made by apt-get's conflict resolution system. If a hyphen is appended to the package name (with no intervening space), the identified package will be removed if it is installed. Similarly, a plus sign can be used to designate a package to install. A specific version of a package can be selected for installation by following the package name with an equals and the version of the package to select. This will cause that version to be located and selected for install. Alternatively a specific distribution can be selected by following the package name with a slash and the version of the distribution or the archive name (stable, testing, unstable).

Both of the version selection mechanisms can downgrade packages and must be used with care.

Finally, the apt_preferences mechanism allows creating an alternative installation policy for individual packages.

If no package matches the given expression and the expression contains one of '.', '?' or '*', it is assumed to be a POSIX regular expression and it is applied to all package names in the database. Any matches are then installed (or removed). Note that matching is done by substring, so "lo.*" matches "how-lo" and "lowest". If this is undesired, the regular expression can be anchored with a '^' or '$' character, or a more specific regular expression can be created.

Update, upgrade and dist-upgrade

  • update is used to resynchronize the package index files from their sources. The lists of available packages are fetched from the location(s) specified in /etc/apt/sources.list. For example, when using a Debian archive, this command retrieves and scans the Packages.gz files, so that information about new and updated packages is available. An update should always be performed before a safe-upgrade or dist-upgrade. Be aware that the overall progress meter will not always be correct as the size of the package files cannot be known in advance.

  • upgrade is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list. Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. New versions of currently installed packages that cannot be upgraded without changing the install status of another package will be left at their current version. An update must be performed first, so that apt-get knows that new versions of packages are available.

  • dist-upgrade, in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files. aptitude
    Aptitude (program)
    aptitude is a front-end to the Advanced Packaging Tool . It displays a list of software packages and allows the user to interactively pick packages to install or remove. It has an especially powerful search system utilizing flexible search patterns...

     has a smarter dist-upgrade feature called full-upgrade.

Configuration and files

/etc/apt has the apt configuration folders and files.

apt-config is the APT Configuration Query program. apt-config dump shows the configuration.

Files

  • /etc/apt/sources.list: Locations to fetch packages from.
  • /etc/apt/sources.list.d/: Additional source list fragments.
  • /etc/apt/apt.conf: APT configuration file.
  • /etc/apt/apt.conf.d/: APT configuration file fragments.
  • /etc/apt/preferences: version preferences file. This is where you would specify "pinning", i.e. a preference to get certain packages from a separate source or from a different version of a distribution.
  • /var/cache/apt/archives/: storage area for retrieved package files.
  • /var/cache/apt/archives/partial/: storage area for package files in transit.
  • /var/lib/apt/lists/: storage area for state information for each package resource specified in sources.list
  • /var/lib/apt/lists/partial/: storage area for state information in transit.

Sources

APT relies on the concept of repositories
Software repository
A software repository is a storage location from which software packages may be retrieved and installed on a computer.- Discussion :Many software publishers and other organizations maintain servers on the Internet for this purpose, either free of charge or for a subscription fee...

 in order to find software and resolve dependencies. For apt, a repository is a directory containing packages along with an index file. This can be specified as a networked or CDROM location. The Debian project keeps a central repository of over 25,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 (/etc/apt/sources.list) and then be queried by APT. Graphical front-ends often allow modifying sources.list more simply (apt-setup). 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
Compact Disc
The Compact Disc is an optical disc used to store digital data. It was originally developed to store and playback sound recordings exclusively, but later expanded to encompass data storage , write-once audio and data storage , rewritable media , Video Compact Discs , Super Video Compact Discs ,...

 and other storage media (USB keydrive, hard disks...) can be used as well, using apt-cdrom or adding file:/ to the source list file. Apt-cdrom can specify a different folder than a cd-rom, using the -d option (i.e. a hard disk or a USB keydrive). The Debian CDs available for download contain Debian repositories. This allows non-networked machines to be upgraded. Also one can use apt-zip.

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.

APT pinning

The APT pinning feature 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 (/etc/apt/preferences) must be modified, although graphical front-ends often make pinning simpler.

Front-ends

Several other front-ends to APT exist, which provide more advanced installation functions and more intuitive interfaces. These include:
  • Synaptic Package Manager
    Synaptic Package Manager
    Synaptic is a computer program which is a GTK+ graphical user interface front-end to the Advanced Packaging Tool for the Debian package management system. Synaptic is usually used on systems based on deb packages but can also be used on systems based on RPM packages...

    , a GTK+
    GTK+
    GTK+ is a cross-platform widget toolkit for creating graphical user interfaces. It is licensed under the terms of the GNU LGPL, allowing both free and proprietary software to use it. It is one of the most popular toolkits for the X Window System, along with Qt.The name GTK+ originates from GTK;...

     graphical user interface
    Graphical user interface
    In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...

  • Ubuntu Software Center
    Ubuntu Software Center
    Ubuntu Software Center is a computer program for browsing, installing and removing software on the Ubuntu operating system. Based upon the GNOME application, gnome-app-install, which is similar in function and appearance, it serves as a GTK+ graphical user interface front-end to the Advanced...

    , a GTK+
    GTK+
    GTK+ is a cross-platform widget toolkit for creating graphical user interfaces. It is licensed under the terms of the GNU LGPL, allowing both free and proprietary software to use it. It is one of the most popular toolkits for the X Window System, along with Qt.The name GTK+ originates from GTK;...

     graphical user interface
    Graphical user interface
    In computing, a graphical user interface is a type of user interface that allows users to interact with electronic devices with images rather than text commands. GUIs can be used in computers, hand-held devices such as MP3 players, portable media players or gaming devices, household appliances and...

     replacement for Synaptic
  • aptitude
    Aptitude (program)
    aptitude is a front-end to the Advanced Packaging Tool . It displays a list of software packages and allows the user to interactively pick packages to install or remove. It has an especially powerful search system utilizing flexible search patterns...

    , a versatile alternative to dselect
    Dselect
    dselect is a computer program used to manage software packages in the Debian operating system.dselect is one of the oldest front-ends to dpkg, and the bulk of its development happened when it was originally written by Ian Jackson, who wrote it alongside dpkg....

  • KPackage
    KPackage
    KPackage was KDE's package manager frontend.It supported BSD, Debian, Gentoo, RPM and Slackware packages. It provided a GUI for the management and upgrade of existing packages and the installation and acquirement of new packages...

    , part of KDE
    KDE
    KDE is an international free software community producing an integrated set of cross-platform applications designed to run on Linux, FreeBSD, Microsoft Windows, Solaris and Mac OS X systems...

  • Adept Package Manager
    Adept Package Manager
    Adept Manager is a graphical user interface to the Advanced Packaging Tool for KDE. It was developed by Peter Ročkai and was sponsored by Canonical Ltd. through the Kubuntu project, where it replaced the Kynaptic package manager....

    , a graphical user interface for KDE
    KDE
    KDE is an international free software community producing an integrated set of cross-platform applications designed to run on Linux, FreeBSD, Microsoft Windows, Solaris and Mac OS X systems...

     (deb, rpm, bsd)
  • PackageKit
    PackageKit
    PackageKit is an open source and free suite of software applications designed to provide a consistent and high-level front end for a number of different package management systems...

    , a freedesktop.org
    Freedesktop.org
    freedesktop.org is a project to work on interoperability and shared base technology for free software desktop environments for the X Window System on Linux and other Unix-like operating systems. It was founded by Havoc Pennington from Red Hat in March 2000.The organisation focuses on the user....

     frontend.
  • GDebi
    Gdebi
    GDebi is a tool that can install .deb packages. It is available with a graphical interface, but also has a command line option. It is updated by using Update Manager....

    , a GTK-based tool sponsored for Ubuntu. (There is also a Qt version, available in the Ubuntu repositories a gdebi-kde.)
  • apt-cdrom, a way to add a new CDROM to APT's list of available sources.lists (list of available repositories). It is necessary to use apt-cdrom to add CDs to the APT system, it cannot be done by hand.
  • apt-zip, a way to use apt with removable media
    Removable media
    In computer storage, removable media refers to storage media which is designed to be removed from the computer without powering the computer off.Some types of removable media are designed to be read by removable readers and drives...

    , specifically USB flash drive
    USB flash drive
    A flash drive is a data storage device that consists of flash memory with an integrated Universal Serial Bus interface. flash drives are typically removable and rewritable, and physically much smaller than a floppy disk. Most weigh less than 30 g...

    s.
  • apt:foo, an interface for downloading and installing software by clicking on a web-link (experimental)
  • gnome-apt, a gtk/GNOME
    GNOME
    GNOME is a desktop environment and graphical user interface that runs on top of a computer operating system. It is composed entirely of free and open source software...

    -widget-based graphical front-end.
  • Cydia
    Cydia
    Cydia is a large genus of tortrix moths, belonging to the tribe Grapholitini of subfamily Olethreutinae. Its distinctness from and delimitation versus the tribe's type genus Grapholita requires further study....

    , a package manager for jailbroken iOS partially based on APT (ported to iOS as part of the Telesphoreo project).
  • Hildon Application Manager (Maemo Application), a Maemo
    Maemo
    Maemo is a software platform developed by the Maemo community for smartphones and Internet tablets. It is based on the Debian Linux distribution, but has no relation to it...

     front-end
  • APT Daemon, a front-end that runs as a service to allow standard users to install software through PolicyKit
    PolicyKit
    PolicyKit is an operating system component for controlling system-wide privileges in Unix-like operating systems. It provides an organized way for non-privileged processes to communicate with privileged ones. In contrast to systems such as sudo, it does not grant root permission to an entire...

     and is in turn the framework that the Ubuntu Software Center
    Ubuntu Software Center
    Ubuntu Software Center is a computer program for browsing, installing and removing software on the Ubuntu operating system. Based upon the GNOME application, gnome-app-install, which is similar in function and appearance, it serves as a GTK+ graphical user interface front-end to the Advanced...

     (along with the Linux Mint Software Manager) uses to not be root
    Superuser
    On many computer operating systems, the superuser is a special user account used for system administration. Depending on the operating system, the actual name of this account might be: root, administrator or supervisor....

     and still run.


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.

History

The original effort that led to the apt-get program was the dselect
Dselect
dselect is a computer program used to manage software packages in the Debian operating system.dselect is one of the oldest front-ends to dpkg, and the bulk of its development happened when it was originally written by Ian Jackson, who wrote it alongside dpkg....

 replacement project known by its codename deity. 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.

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 highlights.

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. As originally used, APT is not an acronym, but a proper name. The name gained mindshare during IRC discussions due to the variety of possible acronym 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.

In the end the original goal of the Deity project of replacing the dselect
Dselect
dselect is a computer program used to manage software packages in the Debian operating system.dselect is one of the oldest front-ends to dpkg, and the bulk of its development happened when it was originally written by Ian Jackson, who wrote it alongside dpkg....

 UI was a failure. Work on the user interface (UI) portion of the project was abandoned (the UI directories were removed from the CVS
Concurrent Versions System
The Concurrent Versions System , also known as the Concurrent Versioning System, is a client-server free software revision control system in the field of software development. Version control system software keeps track of all work and all changes in a set of files, and allows several developers ...

 system) 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 was not 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' program, 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
GNU Privacy Guard
GNU Privacy Guard is a GPL Licensed alternative to the PGP suite of cryptographic software. GnuPG is compliant with RFC 4880, which is the current IETF standards track specification of OpenPGP...

 signing
Digital signature
A digital signature or digital signature scheme is a mathematical scheme for demonstrating the authenticity of a digital message or document. A valid digital signature gives a recipient reason to believe that the message was created by a known sender, and that it was not altered in transit...

 to authenticate the package repositories.

See also

  • AppStream
    AppStream
    AppStream is an agreement between major GNU/Linux vendors to create a common application installer for Linux and one unified application installation GUI and sharing of metadata....

  • Package management system
    Package management system
    In software, a package management system, also called package manager, is a collection of software tools to automate the process of installing, upgrading, configuring, and removing software packages for a computer's operating system in a consistent manner...

  • apt-file
    Apt-file
    apt-file is a command in the Advanced Packaging Tool family that allows you to find which package includes a specific file. Thisapplication provides similar information to the web site http://packages.debian.org....

  • apt-rpm
    Apt-rpm
    APT-RPM is a version of the Advanced Packaging Tool modified to work with the RPM Package Manager. It was originally ported to RPM by Alfredo Kojima and then further developed and improved by Gustavo Niemeyer, both working for the Conectiva Linux distribution at the time.In March 2005 the...

  • Alien
    Alien (software)
    Alien is a computer program that converts between different Linux package formats, written by Joey Hess.-Features:Alien supports conversion between Linux Standard Base, RPM, deb, Stampede , Solaris and Slackware packages...

  • Linux Standard Base
    Linux Standard Base
    The Linux Standard Base is a joint project by several Linux distributions under the organizational structure of the Linux Foundation to standardize the software system structure, including the filesystem hierarchy, used with Linux operating system...

  • PackageKit
    PackageKit
    PackageKit is an open source and free suite of software applications designed to provide a consistent and high-level front end for a number of different package management systems...

  • Pkgsrc
    Pkgsrc
    pkgsrc is a package management system for Unix-like operating systems. It was forked from the FreeBSD ports collection in 1997 as the primary package management system for NetBSD. Since then it has evolved independently: in 1999, support for Solaris was added, later followed by support for other...

  • Wajig
    Wajig
    Wajig is a simplified wrapper to Debian's package management tools including dpkg and APT. Wajig provides the functionality of apt-get, dpkg, dpkg-deb, apt-cache and other tools. These tools launch as a subprocess. Wajig also provides extra functionality beyond that of the stock apt and dpkg tools...

  • APTonCD
    APTonCD
    APTonCD is a tool that can create one or more ISOs, CDs or DVDs with all of the packages the user downloaded via APT-GET or APTITUDE, creating a removable repository that the user can use on other computers....

  • Ubuntu Software Center
    Ubuntu Software Center
    Ubuntu Software Center is a computer program for browsing, installing and removing software on the Ubuntu operating system. Based upon the GNOME application, gnome-app-install, which is similar in function and appearance, it serves as a GTK+ graphical user interface front-end to the Advanced...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK