APT (software)

Last updated
Advanced Package Tool
Developer(s) The Debian Project
Initial release31 March 1998;26 years ago (1998-03-31) [1]
Stable release
2.9.2 [2]   OOjs UI icon edit-ltr-progressive.svg / 23 April 2024;5 days ago (23 April 2024)
Repository
Written in C++
Operating system Unix-like
Type Package manager
License GPLv2+
Website wiki.debian.org/Apt

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. [3] 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. [3]

Contents

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 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 , friendlier than the older dselect 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, [4] [5] [6] [7] which Debian developers attribute to the strict quality controls in Debian's policy. [8] [9]

A major feature of APT is the way it calls dpkg — it does topological sorting 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.

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.

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:

Configuration and files

/etc/apt contains the APT configuration folders and files.

apt-config is the APT Configuration Query program. [11] apt-config dump shows the configuration. [12]

Files

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 location. As of 14 August 2021, the Debian project keeps a central repository of over 50,000 software packages ready for download and installation. [14]

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 discs and other storage media (USB keydrive, hard disks...) can be used as well, using apt-cdrom [15] or adding file:/ URI [16] 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, [17] although graphical front ends often make pinning simpler.

Front ends

Synaptic package manager is one of the front ends available for APT. Synaptic Package Manager.png
Synaptic package manager is one of the front ends available for APT.

Several other front ends to APT exist, which provide more advanced installation functions and more intuitive interfaces. These include:

APT front ends can:

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 replacement project known by its codename Deity. [23] 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). [24]

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. [25]

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. [26]

In the end the original goal of the Deity project of replacing the dselect 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 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 signing to authenticate the package repositories. [27]

Variants

APT was originally designed as a front end for dpkg to work with Debian's .deb packages. A version of APT modified to also work with the RPM Package Manager system was released as APT-RPM. [28] The Fink project has ported APT to Mac OS X for some of its own package management tasks, [29] 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. [30]

See also

Related Research Articles

<span class="mw-page-title-main">Debian</span> Linux distribution based on free and open-source software

Debian, also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software and optionally non-free firmware or software developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. The first version of Debian (0.01) was released on September 15, 1993, and its first stable version (1.1) was released on June 17, 1996. The Debian Stable branch is the most popular edition for personal computers and servers. Debian is also the basis for many other distributions that have different purposes, like Proxmox for servers, Ubuntu or Linux Mint for desktops, Kali for penetration testing, and Pardus and Astra for government use.

<span class="mw-page-title-main">Linux distribution</span> Operating system based on the Linux kernel

A Linux distribution 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 of the Linux distributions, which are available for a wide variety of systems ranging from embedded devices and personal computers to powerful supercomputers.

<span class="mw-page-title-main">Package manager</span> Software tools for handling software packages

A package manager or package-management system is a collection of software tools that automates the process of installing, upgrading, configuring, and removing computer programs for a computer in a consistent manner.

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.

yum (software) Free and open-source command-line package management utility

The Yellowdog Updater Modified (YUM) is a free and open-source command-line package-management utility for computers running the Linux operating system using the RPM Package Manager. Though YUM has a command-line interface, several other tools provide graphical user interfaces to YUM functionality.

deb is the format, as well as filename extension of the software package format for the Debian Linux distribution and its derivatives.

<span class="mw-page-title-main">Synaptic (software)</span> GTK GUI front end for APT package manager

Synaptic is a GTK-based graphical user interface for the APT package manager used by the Debian Linux distribution and its derivatives. Synaptic is usually used on systems based on deb packages but can also be used on systems based on RPM packages. It can be used to install, remove and upgrade software packages and to add repositories.

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.

<span class="mw-page-title-main">VectorLinux</span> Linux distribution

VectorLinux, abbreviated VL, is a Linux distribution for the x86 platform based on the Slackware Linux distribution, originally developed by Canadian developers Robert S. Lange and Darell Stavem. Since version 7 the Standard Edition is also available for the x86-64 platform, known as VLocity64 7.

<span class="mw-page-title-main">Debian configuration system</span>

debconf is a software utility for performing system-wide configuration tasks on Unix-like operating systems. It is developed for the Debian Linux distribution, and is closely integrated with Debian's package management system, dpkg.

<span class="mw-page-title-main">Debian-Installer</span> System installer for Debian

Debian-Installer is a system installer designed for the Debian Linux distribution. It originally appeared in the Debian release 3.1 (Sarge), released on June 6, 2005, although the first release of a Linux distribution that used it was Skolelinux (Debian-Edu) 1.0, released in June 2004.

<span class="mw-page-title-main">CNR (software)</span>

CNR, or One-Click & Run, was a free one-click software delivery service that was created to make finding and installing Linux software easier. It assisted the user in finding and installing software on their computer, and sat dormant in the system tray when not in use.

The Environment Modules system is a tool to help users manage their Unix or Linux shell environment, by allowing groups of related environment-variable settings to be made or removed dynamically.

<span class="mw-page-title-main">Hildon</span> Linux-based application framework

Hildon is an application framework originally developed for mobile devices running the Linux operating system as well as the Symbian operating system. The Symbian variant of Hildon was discontinued with the cancellation of Series 90. It was developed by Nokia for the Maemo operating system. It focuses on providing a finger-friendly interface. It is primarily a set of GTK extensions that provide mobile-device–oriented functionality, but also provides a desktop environment that includes a task navigator for opening and switching between programs, a control panel for user settings, and status bar, task bar and home applets. It is standard on the Maemo platform used by the Nokia Internet Tablets and the Nokia N900 smartphone.

<span class="mw-page-title-main">Ubiquity (software)</span> Free and open-source system installer for Ubuntu and its derivatives

Ubiquity is the default installer for Ubuntu and its derivatives. It is run from the Live CD or USB and can be triggered to run from the options on the device or on the desktop of the Live mode. It was first introduced in Ubuntu 6.06 LTS "Dapper Drake". At program start, it allows the user to change the language to a local language if they prefer. It is designed to be easy to use.

<span class="mw-page-title-main">RPM Package Manager</span> Package management system

RPM Package Manager (RPM) is a free and open-source package management system. The name RPM refers to the .rpm file format and the package manager program itself. RPM was intended primarily for Linux distributions; the file format is the baseline package format of the Linux Standard Base.

DebWrt is a discontinued, niche Linux distribution mainly installed on embedded systems. It was built on top of an OpenWrt base which was used to load a fully functional version of Debian from the RootFS stored on the attached USB storage device. For easy installation and deinstallation of packages it relied on the dpkg Package management system. DebWrt used the command-line interface of Bash. There was no web-based GUI interface.

A delta update is a software update that requires the user to download only those parts of the software's code that are new, or have been changed from their previous state, in contrast to having to download the entire program. The use of delta updates can save significant amounts of time and computing bandwidth. The name "delta" derives from the mathematical science use of the Greek letter delta, Δ or δ to denote change.

<span class="mw-page-title-main">Leafpad</span> Lightweight text editor

Leafpad is a free and open-source graphical text editor for Linux, Berkeley Software Distribution (BSD), and Maemo that is similar to the Microsoft Windows program Notepad. Created with the focus of being a lightweight text editor with minimal dependencies, it is designed to be simple-to-use and easy-to-compile.

References

  1. "Initial release". apt package changelog. The Debian project. 31 March 1998. Retrieved 18 December 2021.
  2. "2.9.2 · Tags · APT Developers / apt · GitLab". 23 April 2024. Retrieved 28 April 2024.
  3. 1 2 3 "apt-get(8)". Debian Manpages. Retrieved 18 December 2021.
  4. Byfield, Bruce (9 December 2004). "An apt-get primer" . Retrieved 18 December 2021.
  5. "From the archives: the best distros of 2000". Tux radar. Archived from the original on 26 July 2020.
  6. Dorgan, David (19 January 2004). "Migrating to Debian". linux.ie. Archived from the original on 13 May 2006.
  7. "Mobile Linux development with Familiar and a minimal Debian". Mobile Tux. Archived from the original on 15 September 2008.
  8. "Why Debian" . Retrieved 18 December 2021.
  9. "Debian policy manual" . Retrieved 18 December 2021.
  10. "Discussion on dist-upgrade vs. full-upgrade" . Retrieved 18 December 2021.
  11. "apt-config(8)". Debian Manpages. Retrieved 18 December 2021.
  12. "Query APT configuration using apt-config - Debian admin". 2 December 2006. Retrieved 18 December 2021.
  13. "SourcesList". Debian Wiki. Retrieved 18 December 2021.
  14. "Debian 11 "bullseye" released". www.debian.org. Retrieved 2022-05-11.
  15. "apt-cdrom(8)". Debian Manpages. Retrieved 27 December 2021.
  16. e.g. deb file:/mnt/install stable main contrib non-free.{{citation}}: CS1 maint: postscript (link)
  17. "AptConfiguration". Debian Wiki. Retrieved 2020-05-18.
  18. "AptURL". Ubuntu Wiki. Retrieved 27 December 2021.
  19. "How to install software in Ubuntu Linux: A complete guide for newbie". 17 June 2018. Retrieved 27 December 2021.
  20. Jurick, David (2009). iPhone hacks: Pushing the iPhone and iPod touch beyond their limits. O'Reilly Media, Inc. p. 20. ISBN   9780596516642 . Retrieved 27 December 2021.
  21. Adhikari, Richard (20 March 2008). "Android, Schmandroid: Linux on the iPhone". LinuxInsider. Retrieved 27 December 2021.
  22. Mullikin, Glenn (December 2001). "The evolution of Debian package management systems". AUUGN. Vol. 22, no. 4. p. 50. ISSN   1035-7521. gnome-apt was written by Havoc Pennington
  23. White, Brian C. (11 April 1997). ""dselect" replacement project ("deity")". deity@lists.debian.org (Mailing list).
  24. Gunthorpe, Jason (2 March 1998). "It's working". deity@lists.debian.org (Mailing list).
  25. Gunthorpe, Jason (19 March 1998). "Re: 2 things (!)". deity@lists.debian.org (Mailing list).
  26. "A brief history of Debian". debian.org. Archived from the original on 24 August 2003.
  27. "Secure APT". Debian Wiki. Retrieved 27 December 2021.
  28. "APT-RPM". apt-rpm.org. Archived from the original on 21 April 2008. Retrieved 27 December 2021.
  29. "Fink - About". www.finkproject.org. Archived from the original on 11 May 2008. Retrieved 27 December 2021.
  30. "Inspecting and extracting Debian package contents". Packagecloud blog. 13 October 2015. Retrieved 27 December 2021.