APT (software) explained

Advanced Package Tool
Developer:The Debian Project
Released:[1]
Operating System:Unix-like
Genre:Package manager
License:GPLv2+

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

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

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.[10] apt-config dump shows the configuration.[11]

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

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[14] 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,[15] 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:

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.[21] This project was commissioned in 1997 by Brian White, the Debian release manager at the time. The 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).[22]

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

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

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

Variants

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

See also

External links

Notes and References

  1. Web site: Initial release . 31 March 1998 . apt package changelog . The Debian project . 18 December 2021.
  2. Web site: apt-get(8). Debian Manpages. 18 December 2021.
  3. Web site: An apt-get primer. Bruce. Byfield. 9 December 2004. 18 December 2021.
  4. Web site: From the archives: the best distros of 2000. Tux radar. dead. https://web.archive.org/web/20200726074050/https://linuxformat.com/tuxradarchive/content/archives-best-distros-2000. 26 July 2020.
  5. Web site: Migrating to Debian. David. Dorgan. linux.ie. 19 January 2004. https://web.archive.org/web/20060513054821/http://www.linux.ie/lists/pipermail/cork/2004-January/003744.html. 13 May 2006. dead.
  6. Web site: Mobile Linux development with Familiar and a minimal Debian. Mobile Tux. dead. https://web.archive.org/web/20080915152357/http://www.vieka.com/mobiletux/debian.htm. 15 September 2008.
  7. Web site: Why Debian. 18 December 2021.
  8. Web site: Debian policy manual. 18 December 2021.
  9. Web site: Discussion on dist-upgrade vs. full-upgrade. 18 December 2021.
  10. Web site: apt-config(8). Debian Manpages. 18 December 2021.
  11. Web site: Query APT configuration using apt-config - Debian admin. 2 December 2006 . 18 December 2021.
  12. Web site: SourcesList. Debian Wiki. 18 December 2021.
  13. Web site: Debian 11 "bullseye" released . 2022-05-11 . www.debian.org.
  14. Web site: apt-cdrom(8). Debian Manpages. 27 December 2021.
  15. Web site: AptConfiguration. Debian Wiki. 2020-05-18.
  16. Web site: AptURL. Ubuntu Wiki. 27 December 2021.
  17. Web site: How to install software in Ubuntu Linux: A complete guide for newbie. 17 June 2018. 27 December 2021.
  18. Book: Jurick, David. iPhone hacks: Pushing the iPhone and iPod touch beyond their limits. 27 December 2021. 2009. O'Reilly Media, Inc.. 9780596516642. 20.
  19. Web site: Android, Schmandroid: Linux on the iPhone. Richard. Adhikari. 20 March 2008. LinuxInsider. 27 December 2021.
  20. [{{Google books|id=ColExJoEq1UC|page=50|text=Havoc Pennington|plainurl=yes}} The evolution of Debian package management systems]. Glenn. Mullikin. AUUGN.. 22. 4. December 2001. 1035-7521. 50. gnome-apt was written by Havoc Pennington.
  21. "dselect" replacement project ("deity"). Brian C.. White. deity@lists.debian.org. 11 April 1997.
  22. It's working. Jason. Gunthorpe. deity@lists.debian.org. 2 March 1998.
  23. Re: 2 things (!). Jason. Gunthorpe. deity@lists.debian.org. 19 March 1998.
  24. Web site: A brief history of Debian. debian.org. dead. https://web.archive.org/web/20030824115706/http://www.debian.org/doc/manuals/project-history/ch-detailed.en.html. 24 August 2003. en.
  25. Web site: Secure APT. Debian Wiki. 27 December 2021.
  26. Web site: APT-RPM. apt-rpm.org. 27 December 2021. https://web.archive.org/web/20080421014529/http://apt-rpm.org/about.shtml. 21 April 2008. live.
  27. Web site: Fink - About. www.finkproject.org. 27 December 2021. https://web.archive.org/web/20080511210043/http://www.finkproject.org/about.php. 11 May 2008. live.
  28. Web site: Inspecting and extracting Debian package contents. Packagecloud blog. 13 October 2015. 27 December 2021.