Apt-get
   HOME

TheInfoList



OR:

Advanced package tool, or APT, is a
free-software Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, no ...
user interface In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine f ...
that works with core libraries to handle the installation and removal of software on
Debian Debian (), also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software, developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. The first version of D ...
, and
Debian Debian (), also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software, developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. The first version of D ...
-based
Linux distribution A Linux distribution (often abbreviated as distro) is an operating system made from a software collection that includes the Linux kernel and, often, a package management system. Linux users usually obtain their operating system by downloading one ...
s. APT simplifies the process of managing software on
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
computer systems by automating the retrieval, configuration and installation of software packages, either from precompiled files or by
compiling In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
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++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
library of functions; APT also includes command-line programs for dealing with packages, which use the library. Three such programs are apt, apt-get and apt-cache. 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
dpkg dpkg is the software at the base of the package management system in the free operating system Debian and its numerous derivatives. dpkg is used to install, remove, and provide information about .deb packages. dpkg (Debian Package) itself is a ...
, friendlier than the older
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 ...
front-end. While dpkg 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 dpkg — it does
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 directed edge ''uv'' from vertex ''u'' to vertex ''v'', ''u'' comes before ''v'' in the ordering. For ins ...
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 of dpkg. However, it only does this when it is unable to calculate how to avoid the reason dpkg 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, libc6 would be the argument provided, not libc6_1.9.6-2.deb). 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 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. The dependency issue arises when several packages have d ...
. Another distinction is the retrieval of packages from remote repositories. APT uses a location configuration file (/etc/apt/sources.list) 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 apt_preferences mechanism allows the user to create an alternative installation policy for individual packages. The user can specify packages using a POSIX
regular expression A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" or ...
. 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 apt and apt-get that facilitate updating installed packages include: * 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. * 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. * full-upgrade (apt) and dist-upgrade (apt-get), in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt and apt-get 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 /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files.
aptitude An aptitude is a component of a competence to do a certain kind of work at a certain level. Outstanding aptitude can be considered "talent". Aptitude is inborn potential to perform certain kinds of activities, whether physical or mental, and ...
has a smarter dist-upgrade feature called full-upgrade.


Configuration and files

/etc/apt contains 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.d/: Directory with version preferences files. This is where you would specify "
pinning Pinning may refer to: * Pinning, the effect of certain weapons that cause their targets to be pinned down * Pinning ceremony (nursing), a symbolic welcoming of new graduates into the nursing profession * Pinning force, a force acting on a pinned ...
", 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 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
CD-ROM A CD-ROM (, compact disc read-only memory) is a type of read-only memory consisting of a pre-pressed optical compact disc that contains data. Computers can read—but not write or erase—CD-ROMs. Some CDs, called enhanced CDs, hold both comput ...
location. the Debian project keeps a central repository of over 50,000 software packages ready for download and installation. 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 and will be kept up-to-date automatically. In addition to network repositories,
compact disc The compact disc (CD) is a Digital media, digital optical disc data storage format that was co-developed by Philips and Sony to store and play digital audio recordings. In August 1982, the first compact disc was manufactured. It was then rele ...
s and other storage media (USB keydrive, hard disks...) can be used as well, using apt-cdrom or adding file:/ URI to the source list file. apt-cdrom can specify a folder other 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. One can also 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 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 (/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'', a
GTK GTK (formerly GIMP ToolKit and GTK+) is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and propriet ...
graphical user interface The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
* ''
Ubuntu Software Center Ubuntu Software Center, or simply Software Center, is a discontinued high-level graphical front end for the APT/dpkg package management system. It is free software written in Python, PyGTK/ PyGObject based on GTK. The program was created ...
'', a
GTK GTK (formerly GIMP ToolKit and GTK+) is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and propriet ...
graphical user interface The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
developed by the Ubuntu project * ''
aptitude An aptitude is a component of a competence to do a certain kind of work at a certain level. Outstanding aptitude can be considered "talent". Aptitude is inborn potential to perform certain kinds of activities, whether physical or mental, and ...
'', a console client with
CLI CLI may refer to: Computing * Call Level Interface, an SQL database management API * Command-line interface, of a computer program * Command-line interpreter or command language interpreter; see List of command-line interpreters * CLI (x86 instruc ...
and
ncurses ncurses (new curses) is a programming library providing an application programming interface (API) that allows the programmer to write text-based user interfaces (TUI) in a terminal-independent manner. It is a toolkit for developing "GUI-like" ...
-based TUI interfaces * ''
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. Additionall ...
'', part of
KDE KDE is an international Free software movement, free software community that develops free and open-source software. As a central development hub, it provides tools and resources that allow collaborative work on this kind of software. Well-know ...
* ''Adept package manager'', a graphical user interface for
KDE KDE is an international Free software movement, free software community that develops free and open-source software. As a central development hub, it provides tools and resources that allow collaborative work on this kind of software. Well-know ...
(deb, rpm, bsd) * ''
PackageKit PackageKit is a free and open-source suite of software applications designed to provide a consistent and high-level front end for a number of different package management systems. PackageKit was created by Richard Hughes in 2007, and first intr ...
'', a
freedesktop.org freedesktop.org (fd.o) is a project to work on interoperability and shared base technology for free-software desktop environments for the X Window System (X11) and Wayland on Linux and other Unix-like operating systems. It was founded by Hav ...
frontend. * ''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 Expandable storage is a form of computer storage that is designed to be inserted and removed from a system. Some forms of removable media, such as optical discs, require a reader to be installed in the computer, while others, such as USB flash dri ...
, specifically
USB flash drive A USB flash drive (also called a thumb drive) is a data storage device that includes flash memory with an integrated USB interface. It is typically removable, rewritable and much smaller than an optical disc. Most weigh less than . Since firs ...
s. * ''aptURL'', an Ubuntu software package that enables end-user applications to install with a single-click through a browser. * ''
Cydia Cydia is a graphical user interface of APT (Advanced Package Tool) for iOS. It enables a user to find and install software not authorized by Apple on jailbroken iPhones, iPads and iPod Touch devices. It also refers to digital distribution pla ...
'', a package manager for jailbroken iOS based on APT (ported to iOS as part of the Telesphoreo project).
''Sileo''
like
Cydia Cydia is a graphical user interface of APT (Advanced Package Tool) for iOS. It enables a user to find and install software not authorized by Apple on jailbroken iPhones, iPads and iPod Touch devices. It also refers to digital distribution pla ...
, a package manager for jailbroken iOS based on newer versions of APT (ported to iOS by the Electra team) * ''gnome-apt'', a GTK/
GNOME A gnome is a mythological creature and diminutive spirit in Renaissance magic and alchemy, first introduced by Paracelsus in the 16th century and later adopted by more recent authors including those of modern fantasy literature. Its characte ...
-widget-based graphical front-end. Developed by
Havoc Pennington Robert Sanford Havoc Pennington (born c. 1976) is an American computer engineer and entrepreneur. He is known in the free software movement due to his work on HAL, GNOME, Metacity, GConf, and D-Bus. History Havoc Pennington graduated from the ...
* ''Muon discover (previous Muon software center)'', a Qt-based graphical user interface * ''Hildon application manager (Maemo application)'', a
Maemo Maemo is a software platform originally developed by Nokia, now developed by the community, for smartphones and Internet tablets. The platform comprises both the Maemo operating system and SDK. Maemo played a key role in Nokia's strategy to com ...
front-end * ''apticron'', a service designed to be run via
cron The cron command-line utility is a job scheduler on Unix-like operating systems. Users who set up and maintain software environments use cron to schedule jobs (commands or shell scripts), also known as cron jobs, to run periodically at fixed ti ...
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 Polkit (formerly PolicyKit) is a 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. Polkit allows a level of control ...
and is in turn the framework used by
Ubuntu software center Ubuntu Software Center, or simply Software Center, is a discontinued high-level graphical front end for the APT/dpkg package management system. It is free software written in Python, PyGTK/ PyGObject based on GTK. The program was created ...
(along with the Linux Mint software manager). * ''Package installer'', part of MX Linu

*
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 Ubuntu#Package_Archives, 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 apt-get program was the
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 ...
replacement project known by its codename ''Deity''. This project was commissioned in 1997 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 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
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 ...
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 Concurrent Versions System (CVS, also known as the Concurrent Versioning System) is a revision control system originally developed by Dick Grune in July 1986. CVS operates as a front end to RCS, an earlier system which operates on single fil ...
) 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 user interfaces on top of libapt-pkg. 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 Cryptography, or cryptology (from grc, , translit=kryptós "hidden, secret"; and ''graphein'', "to write", or '' -logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of adve ...
signing to authenticate the package repositories.


Variants

APT was originally designed as a front-end for
dpkg dpkg is the software at the base of the package management system in the free operating system Debian and its numerous derivatives. dpkg is used to install, remove, and provide information about .deb packages. dpkg (Debian Package) itself is a ...
to work with Debian's
.deb deb is the format, as well as extension of the software package format for the Debian Linux distribution and its derivatives. Design Debian packages are standard Unix ar archives that include two tar archives. One archive holds the cont ...
packages. A version of APT modified to also work with the
RPM Package Manager RPM Package Manager (RPM) (originally Red Hat Package Manager, now a recursive acronym) is a free and open-source package management system. The name RPM refers to the file format and the package manager program itself. RPM was intended primaril ...
system was released as APT-RPM. The Fink project has ported APT to
Mac OS X macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
for some of its own package management tasks, and APT is also available in
OpenSolaris OpenSolaris () is a discontinued open-source computer operating system based on Solaris and created by Sun Microsystems. It was also, perhaps confusingly, the name of a project initiated by Sun to build a developer and user community around th ...
.


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.


See also

*
Alien Alien primarily refers to: * Alien (law), a person in a country who is not a national of that country ** Enemy alien, the above in times of war * Extraterrestrial life, life which does not originate from Earth ** Specifically, intelligent extrater ...
*
AppStream AppStream is an agreement between major Linux vendors (i.e. Red Hat, Canonical, SUSE, Debian, Mandriva, etc.) to create an infrastructure for application installers on Linux and sharing of metadata. The initiative was started as early as 19-21 Ja ...
* APTonCD *
GNU Guix GNU Guix () is a functional cross-platform package manager and a tool to instantiate and manage Unix-like operating systems, based on the Nix package manager. Configuration and package recipes are written in Guile Scheme. GNU Guix is the default ...
* Wajig * List of software package management systems


References


External links

*
APT HOWTO

Apt Tutorial


{{Package management systems Command-line software Cross-platform free software Debian Dpkg Free package management systems Free software Free software programmed in C++ Linux package management-related software Software update managers Ubuntu