APT (software)

Advanced package tool, or APT, is a free-software user interface that works with core libraries to handle the installation and removal of software on Debian and Debian-based Linux distributions. APT simplifies the process of managing software on Unix-like computer systems by automating the retrieval, configuration and installation of software packages, either from precompiled files or by compiling source code.

Usage
APT is a collection of tools distributed in a package named apt. A significant part of APT is defined in a C++ library of functions; APT also includes command-line programs for dealing with packages, which use the library. Three such programs are,   and. They are commonly used in examples because they are simple and ubiquitous. The apt package is of "important" priority in all current Debian releases, and is therefore included in a default Debian installation. APT can be considered a front end to, friendlier than the older   front end. While  performs actions on individual packages, APT manages 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,   which Debian developers attribute to the strict quality controls in Debian's policy.

A major feature of APT is the way it calls  — it does topological sorting of the list of packages to be installed or removed and calls   in the best possible sequence. In some cases, it utilizes the  options of. However, it only does this when it is unable to calculate how to avoid the reason  requires the action to be forced.

Installing software
The user indicates one or more packages to be installed. Each package name is phrased as just the name portion of the package, not a fully qualified filename (for instance, in a Debian system,  would be the argument provided, not  ). Notably, APT automatically gets and installs packages upon which the indicated package depends (if necessary). This was an original distinguishing characteristic of APT-based package management systems, as it avoided installation failure due to missing dependencies, a type of dependency hell.

Another distinction is the retrieval of packages from remote repositories. APT uses a location configuration file to locate the desired packages, which might be available on the network or a removable storage medium, for example, and retrieve them, and also obtain information about available (but not installed) packages.

APT provides other command options to override decisions made by apt-get's conflict resolution system. One option is to force a particular version of a package. This can downgrade a package and render dependent software inoperable, so the user must be careful.

Finally, the  mechanism allows the user to create an alternative installation policy for individual packages.

The user can specify packages using a POSIX regular expression.

APT searches its cached list of packages and lists the dependencies that must be installed or updated.

APT retrieves, configures and installs the dependencies automatically.

Triggers are the treatment of deferred actions.

Update, upgrade and dist-upgrade
Usage modes of  and   that facilitate updating installed packages include:
 * is used to resynchronize the package index files from their sources. The lists of available packages are fetched from the location(s) specified in . For example, when using a Debian archive, this command retrieves and scans the   files, so that information about new and updated packages is available.
 * is used to install the newest versions of all packages currently installed on the system from the sources enumerated in . 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.
 * and , in addition to performing the function of  , also intelligently handles changing dependencies with new versions of packages;   and   have a "smart" conflict resolution system, and will attempt to upgrade the most important packages at the expense of less important ones if necessary. The   file contains a list of locations from which to retrieve desired package files. aptitude has a smarter   feature called.

Configuration and files
contains the APT configuration folders and files.

is the APT Configuration Query program. shows the configuration.

Files

 * : Locations to fetch packages from.
 * : Additional source list fragments.
 * : APT configuration file.
 * : APT configuration file fragments.
 * : Directory with version preferences files. This is where "pinning" is specified, i.e. a preference to get certain packages from a separate source or from a different version of a distribution.
 * : Storage area for retrieved package files.
 * : Storage area for package files in transit.
 * : Storage area for state information for each package resource specified in
 * : Storage area for state information in transit.

APT pinning
The APT pinning feature allows users 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, 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, a GTK graphical user interface
 * Ubuntu Software Center, a GTK graphical user interface developed by the Ubuntu project
 * aptitude, a console client with CLI and ncurses-based TUI interfaces
 * KPackage, part of KDE
 * Adept package manager, a graphical user interface for KDE (deb, rpm, bsd)
 * PackageKit, a D-Bus frontend, maintained by freedesktop.org, powers GNOME Software and KDE Discover.
 * GDebi, a GTK-based tool sponsored for Ubuntu. (There is also a Qt version, available in the Ubuntu repositories as gdebi-kde.)
 * apt-cdrom, a way to add a new CDROM to APT's list of available repositories (sources.lists). 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, specifically USB flash drives.
 * aptURL, an Ubuntu software package that enables end-user applications to install with a single-click through a browser.
 * Cydia, a package manager for jailbroken iOS based on APT (ported to iOS as part of the Telesphoreo project).
 * Sileo, like Cydia, a package manager for jailbroken iOS based on newer versions of APT (ported to iOS by the Electra team)
 * gnome-apt, a GTK/GNOME-widget-based graphical front end. Developed by Havoc Pennington
 * Muon discover (previous Muon software center), a Qt-based graphical user interface
 * Hildon application manager (Maemo application), a Maemo front end
 * apticron, a service designed to be run via cron to email notices of pending updates to a system administrator (sysadmin).
 * APT Daemon, a front end that runs as a service to allow users to install software through PolicyKit and is in turn the framework used by Ubuntu software center (along with the Linux Mint software manager).
 * Package installer, part of MX Linux.
 * Apt-offline: A convenient way to make any available non-containerized change to any Debian-type Linux installation without using a direct Internet connection. However, a temporary direct connection can be required, such as to install Apt-offline on some of the relevant types of Linux, and to add PPA's to the sources-list.

APT front ends can:
 * search for new packages;
 * upgrade packages;
 * install or remove packages and
 * 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  program was the   replacement project known by its codename Deity. This project was commissioned in 1997 by Brian White, the Debian release manager at the time. The first functional version of  was called   and was only intended to be a test program for the core library functions that would underpin the new user interface (UI).

Much of the original development of APT was done on Internet relay chat (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.

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  user interface was a failure. Work on the user interface portion of the project was abandoned (the user interface directories were removed from the concurrent versions system) after the first public release of. The response to APT as a  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 user interfaces on top of.

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.

Variants
APT was originally designed as a front end for dpkg to work with Debian's  packages. A version of APT modified to also work with the RPM Package Manager system was released as 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.

apt-file
apt-file is a command, packaged separately from APT, to find which package includes a specific file, or to list all files included in a package on remote repositories.