APT (software): Difference between revisions
m Version bump |
→Front ends: minor ce |
||
(45 intermediate revisions by 34 users not shown) | |||
Line 1: | Line 1: | ||
{{short description|Free software package management system}} |
{{short description|Free software package management system}} |
||
{{Other uses|APT (disambiguation)#Computing and software}} |
{{Other uses|APT (disambiguation)#Computing and software}}{{Too technical|date=December 2024}}{{Too detailed|date=December 2024}}{{Infobox software |
||
{{Infobox software |
|||
| name = Advanced Package Tool |
| name = Advanced Package Tool |
||
| screenshot = Apt-get install mediawiki.png |
| screenshot = Apt-get install mediawiki.png |
||
Line 15: | Line 13: | ||
| publisher = The Debian project |
| publisher = The Debian project |
||
| access-date = 18 December 2021}}</ref> |
| access-date = 18 December 2021}}</ref> |
||
| latest release version = |
| latest release version = {{Wikidata|properties|references|edit|P348}} |
||
⚫ | |||
| url = https://packages.debian.org/stable/apt |
|||
| latest preview version = {{Wikidata|properties|references|edit|P348|P548=Q51930650}} |
|||
| title = Details of package apt in bullseye |
|||
⚫ | |||
| work = [[Debian]] packages |
|||
| programming language = {{Wikidata|properties|references|edit|P277}} |
|||
| publisher = The Debian project |
|||
| date = 10 June 2021 |
|||
| access-date = 18 December 2021}}</ref> |
|||
⚫ | |||
| latest preview version = 2.5.3<ref>{{cite web |
|||
| url = https://packages.debian.org/sid/apt |
|||
| title = Details of package apt in sid |
|||
| work = [[Debian]] packages |
|||
| publisher = The Debian project |
|||
| date = 28 September 2022 |
|||
| access-date = 19 October 2022}}</ref> |
|||
⚫ | |||
| programming language = [[C++]] |
|||
| operating system = [[Unix-like]] |
| operating system = [[Unix-like]] |
||
| genre = [[Package manager]] |
| genre = [[Package manager]] |
||
| license = [[GNU General Public License|GPLv2+]] |
| license = [[GNU General Public License|GPLv2+]] |
||
| website = {{URL|https://wiki.debian.org/ |
| website = {{URL|https://wiki.debian.org/AptCLI}} |
||
}} |
}} |
||
'''Advanced |
'''Advanced Package Tool''', or '''APT''', is a [[free software|free-software]] [[Frontend and backend|user interface]] that works with [[Library (computing)|core libraries]] to handle the installation and removal of software on [[Debian]] and Debian-based [[Linux distribution]]s.<ref name=manpage>{{cite web|url=https://manpages.debian.org/unstable/apt/apt-get.8.en.html|title=apt-get(8)|website=Debian Manpages|access-date=18 December 2021}}</ref> APT simplifies the process of managing software on [[Unix-like]] computer systems by automating the retrieval, configuration and installation of [[Package manager|software packages]], either from precompiled files or by [[Compiler|compiling]] source code.<ref name=manpage/> |
||
==Usage== |
==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 <code>apt</code>, <code>apt-get</code> and <code>apt-cache</code>. 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 [[Frontend and backend|front |
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 <code>apt</code>, <code>apt-get</code> and <code>apt-cache</code>. 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 [[Frontend and backend|front end]] to <code>[[dpkg]]</code>, friendlier than the older <code>[[dselect]]</code> front end. While <code>dpkg</code> 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,<ref>{{cite web|title=An apt-get primer|url=https://www.linux.com/news/apt-get-primer/|first=Bruce|last=Byfield|date=9 December 2004|access-date=18 December 2021}}</ref><ref>{{cite web|title=From the archives: the best distros of 2000|url=https://linuxformat.com/tuxradarchive/content/archives-best-distros-2000|publisher=Tux radar|url-status=dead|archive-url=https://web.archive.org/web/20200726074050/https://linuxformat.com/tuxradarchive/content/archives-best-distros-2000|archive-date=26 July 2020}}</ref><ref>{{cite web|title=Migrating to Debian|url=http://www.linux.ie/lists/pipermail/cork/2004-January/003744.html|first=David|last=Dorgan|publisher=linux.ie|date=19 January 2004|archive-url=https://web.archive.org/web/20060513054821/http://www.linux.ie/lists/pipermail/cork/2004-January/003744.html|archive-date=13 May 2006|url-status=dead}}</ref><ref>{{cite web|title=Mobile Linux development with Familiar and a minimal Debian|url=http://www.vieka.com/mobiletux/debian.htm|publisher=Mobile Tux|url-status=dead|archive-url=https://web.archive.org/web/20080915152357/http://www.vieka.com/mobiletux/debian.htm|archive-date=15 September 2008}}</ref> which Debian developers attribute to the strict quality controls in Debian's policy.<ref>{{cite web|url=http://people.debian.org/~srivasta/talks/why_debian/talk.html|title=Why Debian|access-date=18 December 2021}}</ref><ref>{{cite web|url=http://www.debian.org/doc/debian-policy/|title=Debian policy manual|access-date=18 December 2021}}</ref> |
APT is often hailed as one of Debian's best features,{{By whom|date=December 2024}}<ref>{{cite web|title=An apt-get primer|url=https://www.linux.com/news/apt-get-primer/|first=Bruce|last=Byfield|date=9 December 2004|access-date=18 December 2021}}</ref><ref>{{cite web|title=From the archives: the best distros of 2000|url=https://linuxformat.com/tuxradarchive/content/archives-best-distros-2000|publisher=Tux radar|url-status=dead|archive-url=https://web.archive.org/web/20200726074050/https://linuxformat.com/tuxradarchive/content/archives-best-distros-2000|archive-date=26 July 2020}}</ref><ref>{{cite web|title=Migrating to Debian|url=http://www.linux.ie/lists/pipermail/cork/2004-January/003744.html|first=David|last=Dorgan|publisher=linux.ie|date=19 January 2004|archive-url=https://web.archive.org/web/20060513054821/http://www.linux.ie/lists/pipermail/cork/2004-January/003744.html|archive-date=13 May 2006|url-status=dead}}</ref><ref>{{cite web|title=Mobile Linux development with Familiar and a minimal Debian|url=http://www.vieka.com/mobiletux/debian.htm|publisher=Mobile Tux|url-status=dead|archive-url=https://web.archive.org/web/20080915152357/http://www.vieka.com/mobiletux/debian.htm|archive-date=15 September 2008}}</ref> which Debian developers attribute to the strict quality controls in Debian's policy.<ref>{{cite web|url=http://people.debian.org/~srivasta/talks/why_debian/talk.html|title=Why Debian|access-date=18 December 2021}}</ref><ref>{{cite web|url=http://www.debian.org/doc/debian-policy/|title=Debian policy manual|access-date=18 December 2021}}</ref> |
||
A major feature of APT is the way it calls <code>dpkg</code> — it does [[topological sorting]] of the list of packages to be installed or removed and calls <code>dpkg</code> in the best possible sequence. In some cases, it utilizes the <code>--force</code> options of <code>dpkg</code>. However, it only does this when it is unable to calculate how to avoid the reason <code>dpkg</code> requires the action to be forced. |
A major feature of APT is the way it calls <code>dpkg</code> — it does [[topological sorting]] of the list of packages to be installed or removed and calls <code>dpkg</code> in the best possible sequence. In some cases, it utilizes the <code>--force</code> options of <code>dpkg</code>. However, it only does this when it is unable to calculate how to avoid the reason <code>dpkg</code> requires the action to be forced. |
||
Line 73: | Line 59: | ||
<code>/etc/apt</code> contains the APT configuration folders and files. |
<code>/etc/apt</code> contains the APT configuration folders and files. |
||
<code>apt-config</code> is the APT Configuration Query program.<ref>{{cite web|url=https://manpages.debian.org/unstable/apt/apt-config.8.en.html|title=apt-config(8)|website=Debian Manpages|access-date=18 December 2021}}</ref> <code>apt-config dump</code> shows the configuration.<ref>{{cite web|url=http://www.debianadmin.com/query-apt-configuration-using-apt-config.html|title=Query APT configuration using apt-config - Debian admin|access-date=18 December 2021}}</ref> |
<code>apt-config</code> is the APT Configuration Query program.<ref>{{cite web|url=https://manpages.debian.org/unstable/apt/apt-config.8.en.html|title=apt-config(8)|website=Debian Manpages|access-date=18 December 2021}}</ref> <code>apt-config dump</code> shows the configuration.<ref>{{cite web|url=http://www.debianadmin.com/query-apt-configuration-using-apt-config.html|title=Query APT configuration using apt-config - Debian admin|date=2 December 2006 |access-date=18 December 2021}}</ref> |
||
===Files=== |
===Files=== |
||
Line 80: | Line 66: | ||
* <code>/etc/apt/apt.conf</code>: APT configuration file. |
* <code>/etc/apt/apt.conf</code>: APT configuration file. |
||
* <code>/etc/apt/apt.conf.d/</code>: APT configuration file fragments. |
* <code>/etc/apt/apt.conf.d/</code>: APT configuration file fragments. |
||
* <code>/etc/apt/preferences.d/</code>: Directory with version preferences files. This is where |
* <code>/etc/apt/preferences.d/</code>: Directory with version preferences files. This is where "[[#APT pinning|pinning]]" is specified, i.e. a preference to get certain packages from a separate source or from a different version of a distribution. |
||
* <code>/var/cache/apt/archives/</code>: Storage area for retrieved package files. |
* <code>/var/cache/apt/archives/</code>: Storage area for retrieved package files. |
||
* <code>/var/cache/apt/archives/partial/</code>: Storage area for package files in transit. |
* <code>/var/cache/apt/archives/partial/</code>: Storage area for package files in transit. |
||
Line 89: | Line 75: | ||
APT relies on the concept of [[Software repository|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|2021|08|14|post=,}} the Debian project keeps a central repository of over 50,000 software packages ready for download and installation.<ref>{{Cite web |title=Debian 11 "bullseye" released |url=https://www.debian.org/News/2021/20210814.en.html |access-date=2022-05-11 |website=www.debian.org}}</ref> |
APT relies on the concept of [[Software repository|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|2021|08|14|post=,}} the Debian project keeps a central repository of over 50,000 software packages ready for download and installation.<ref>{{Cite web |title=Debian 11 "bullseye" released |url=https://www.debian.org/News/2021/20210814.en.html |access-date=2022-05-11 |website=www.debian.org}}</ref> |
||
Any number of additional repositories can be added to APT's ''sources.list'' configuration file (<code>/etc/apt/sources.list</code>) and then be queried by APT. Graphical front |
Any number of additional repositories can be added to APT's ''sources.list'' configuration file (<code>/etc/apt/sources.list</code>) and then be queried by APT. Graphical front ends often allow modifying <code>sources.list</code> more simply (<code>apt-setup</code>). 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]]s and other storage media (USB keydrive, hard disks...) can be used as well, using <code>apt-cdrom</code><ref>{{cite web|url=https://manpages.debian.org/unstable/apt/apt-cdrom.8.en.html|title=apt-cdrom(8)|website=Debian Manpages|access-date=27 December 2021}}</ref> or adding <code>file:/</code> URI<ref>{{citation|title=''e.g. deb file:/mnt/install stable main contrib non-free''|mode=cs1|postscript=.}}</ref> to the source list file. <code>apt-cdrom</code> can specify a folder other than a CD-ROM, using the <code>-d</code> 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 <code>apt-zip</code>. |
In addition to network repositories, [[compact disc]]s and other storage media (USB keydrive, hard disks...) can be used as well, using <code>apt-cdrom</code><ref>{{cite web|url=https://manpages.debian.org/unstable/apt/apt-cdrom.8.en.html|title=apt-cdrom(8)|website=Debian Manpages|access-date=27 December 2021}}</ref> or adding <code>file:/</code> URI<ref>{{citation|title=''e.g. deb file:/mnt/install stable main contrib non-free''|mode=cs1|postscript=.}}</ref> to the source list file. <code>apt-cdrom</code> can specify a folder other than a CD-ROM, using the <code>-d</code> 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 <code>apt-zip</code>. |
||
Line 98: | Line 84: | ||
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. |
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 (<code>/etc/apt/preferences</code>) must be modified,<ref>{{cite web|url=https://wiki.debian.org/AptConfiguration|title=AptConfiguration|publisher=Debian Wiki|access-date=2020-05-18}}</ref> although graphical front |
In order to do this, the ''pins'' in APT's ''preferences'' file (<code>/etc/apt/preferences</code>) must be modified,<ref>{{cite web|url=https://wiki.debian.org/AptConfiguration|title=AptConfiguration|publisher=Debian Wiki|access-date=2020-05-18}}</ref> although graphical front ends often make pinning simpler. |
||
==Front |
==Front ends== |
||
[[Image:Synaptic Package Manager.png|thumb|300px|[[Synaptic |
[[Image:Synaptic Package Manager.png|thumb|300px|[[Synaptic package manager|Synaptic Package Manager]] is one of the front ends available for APT.]] |
||
Several other [[Frontend and backend|front |
Several other [[Frontend and backend|front ends]] to APT exist, which provide more advanced installation functions and more intuitive interfaces. These include: |
||
* ''[[Synaptic (software)|Synaptic]]'', a [[GTK]] [[graphical user interface]] |
* ''[[Synaptic (software)|Synaptic]]'', a [[GTK]] [[graphical user interface]] |
||
* ''[[Ubuntu Software Center]]'', a [[GTK]] [[graphical user interface]] developed by the Ubuntu project |
* ''[[Ubuntu Software Center]]'', a [[GTK]] [[graphical user interface]] developed by the Ubuntu project |
||
Line 109: | Line 95: | ||
* ''[[KPackage]]'', part of [[KDE]] |
* ''[[KPackage]]'', part of [[KDE]] |
||
* ''Adept package manager'', a graphical user interface for [[KDE]] (deb, rpm, bsd) |
* ''Adept package manager'', a graphical user interface for [[KDE]] (deb, rpm, bsd) |
||
* ''[[PackageKit]]'', a [[freedesktop.org]] |
* ''[[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.) |
* ''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-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. |
||
Line 115: | Line 101: | ||
* ''aptURL'', an Ubuntu software package that enables end-user applications to install with a single-click through a browser.<ref>{{cite web|url=https://wiki.ubuntu.com/AptUrl|title=AptURL|work=Ubuntu Wiki|access-date=27 December 2021}}</ref><ref>{{cite web|url=https://www.ubuntupit.com/how-to-install-software-in-ubuntu-linux-a-complete-guide-for-newbie/|title=How to install software in Ubuntu Linux: A complete guide for newbie|date=17 June 2018|access-date=27 December 2021}}</ref> |
* ''aptURL'', an Ubuntu software package that enables end-user applications to install with a single-click through a browser.<ref>{{cite web|url=https://wiki.ubuntu.com/AptUrl|title=AptURL|work=Ubuntu Wiki|access-date=27 December 2021}}</ref><ref>{{cite web|url=https://www.ubuntupit.com/how-to-install-software-in-ubuntu-linux-a-complete-guide-for-newbie/|title=How to install software in Ubuntu Linux: A complete guide for newbie|date=17 June 2018|access-date=27 December 2021}}</ref> |
||
* ''[[Cydia]]'', a package manager for [[iOS jailbreaking|jailbroken iOS]] based on APT (ported to iOS as part of the Telesphoreo project).<ref>{{cite book|last=Jurick|first=David|title=iPhone hacks: Pushing the iPhone and iPod touch beyond their limits|url=https://books.google.com/books?id=i-gABmh50v8C|access-date=27 December 2021|year=2009|publisher=O'Reilly Media, Inc.|isbn= 9780596516642|page=20}}</ref><ref>{{cite web|url=https://linuxinsider.com/story/android-schmandroid-linux-on-the-iphone-62209.html|title=Android, Schmandroid: Linux on the iPhone|first=Richard|last=Adhikari|date=20 March 2008|publisher=LinuxInsider|access-date=27 December 2021}}</ref> |
* ''[[Cydia]]'', a package manager for [[iOS jailbreaking|jailbroken iOS]] based on APT (ported to iOS as part of the Telesphoreo project).<ref>{{cite book|last=Jurick|first=David|title=iPhone hacks: Pushing the iPhone and iPod touch beyond their limits|url=https://books.google.com/books?id=i-gABmh50v8C|access-date=27 December 2021|year=2009|publisher=O'Reilly Media, Inc.|isbn= 9780596516642|page=20}}</ref><ref>{{cite web|url=https://linuxinsider.com/story/android-schmandroid-linux-on-the-iphone-62209.html|title=Android, Schmandroid: Linux on the iPhone|first=Richard|last=Adhikari|date=20 March 2008|publisher=LinuxInsider|access-date=27 December 2021}}</ref> |
||
* |
* ''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 |
* ''gnome-apt'', a GTK/[[GNOME]]-widget-based graphical front end. Developed by [[Havoc Pennington]]<ref>{{cite newsletter|url={{Google books|id=ColExJoEq1UC|page=50|text=Havoc Pennington|plainurl=yes}}|title=The evolution of Debian package management systems|first=Glenn|last=Mullikin|magazine=AUUGN.|volume=22|number=4|date=December 2001|issn=1035-7521|pages=50|quote=gnome-apt was written by Havoc Pennington}}</ref> |
||
* ''Muon discover (previous Muon software center)'', a Qt-based graphical user interface |
* ''Muon discover (previous Muon software center)'', a Qt-based graphical user interface |
||
* ''Hildon application manager (Maemo application)'', a [[Maemo]] front |
* ''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). |
* ''apticron'', a service designed to be run via [[cron]] to email notices of pending updates to a system administrator (sysadmin). |
||
* ''APT Daemon'', a front |
* ''APT Daemon'', a front end that runs as a [[Daemon (computing)|service]] to allow users to install software through [[Polkit|PolicyKit]] and is in turn the framework used by [[Ubuntu Software Center|Ubuntu software center]] (along with the [[Linux Mint#Software by Linux Mint|Linux Mint software manager]]). |
||
* ''Package installer'', part of MX Linux. |
* ''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 [[Ubuntu#Package_Archives|PPA]]'s to the sources-list. |
||
APT front |
APT front ends can: |
||
* search for new packages; |
* search for new packages; |
||
* upgrade packages; |
* upgrade packages; |
||
Line 130: | Line 116: | ||
* upgrade the whole system to a new release. |
* upgrade the whole system to a new release. |
||
APT front |
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== |
==History== |
||
The original effort that led to the <code>apt-get</code> program was the <code>[[dselect]]</code> replacement project known by its codename ''Deity''.<ref name="d-u 1997-04">{{cite mailing list|url=https://lists.debian.org/debian-user/1997/04/msg00786.html|title="dselect" replacement project ("deity")|first=Brian C.|last=White|mailing-list=deity@lists.debian.org|date=11 April 1997}}</ref> This project was commissioned in 1997 by Brian White, the Debian release manager at the time. The |
The original effort that led to the <code>apt-get</code> program was the <code>[[dselect]]</code> replacement project known by its codename ''Deity''.<ref name="d-u 1997-04">{{cite mailing list|url=https://lists.debian.org/debian-user/1997/04/msg00786.html|title="dselect" replacement project ("deity")|first=Brian C.|last=White|mailing-list=deity@lists.debian.org|date=11 April 1997}}</ref> This project was commissioned in 1997 by Brian White, the Debian release manager at the time. The first functional version of <code>apt-get</code> was called <code>dpkg-get</code> and was only intended to be a test program for the core library functions that would underpin the new user interface (UI).<ref name="deity 1998-03">{{cite mailing list|url=https://lists.debian.org/deity/1998/03/msg00013.html|title=It's working|first=Jason|last=Gunthorpe|mailing-list=deity@lists.debian.org|date=2 March 1998}}</ref> |
||
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. |
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. |
||
Line 146: | Line 132: | ||
==Variants== |
==Variants== |
||
APT was originally designed as a front |
APT was originally designed as a front end for [[dpkg]] to work with Debian's <code>[[deb (file format)|.deb]]</code> packages. A version of APT modified to also work with the [[RPM Package Manager]] system was released as [[APT-RPM]].<ref>{{cite web|url=http://apt-rpm.org/about.shtml|title=APT-RPM|publisher=apt-rpm.org|access-date=27 December 2021|archive-url=https://web.archive.org/web/20080421014529/http://apt-rpm.org/about.shtml|archive-date=21 April 2008|url-status=live}}</ref> The [[Fink (software)|Fink]] project has ported APT to [[macOS|Mac OS X]] for some of its own package management tasks,<ref>{{cite web|url=http://www.finkproject.org/about.php|title=Fink - About|publisher=www.finkproject.org|access-date=27 December 2021|archive-url=https://web.archive.org/web/20080511210043/http://www.finkproject.org/about.php|archive-date=11 May 2008|url-status=live}}</ref> and APT is also available in [[OpenSolaris]]. |
||
==apt-file== |
==apt-file== |
||
Line 155: | Line 141: | ||
* [[Alien (file converter)|Alien]] |
* [[Alien (file converter)|Alien]] |
||
* [[AppStream]] |
* [[AppStream]] |
||
* [[APTonCD]] |
|||
* [[GNU Guix]] |
* [[GNU Guix]] |
||
* [[Wajig]] |
* [[Wajig]] |
||
* [[List of software package management systems]] |
|||
==References== |
==References== |
||
Line 163: | Line 149: | ||
==External links== |
==External links== |
||
{{Wikidata property |1= P3473 |2= P3442 }} |
|||
* {{man|8|apt|Debian}} |
* {{man|8|apt|Debian}} |
||
* [https://www.debian.org/doc/manuals/apt-howto/ APT HOWTO] |
* [https://www.debian.org/doc/manuals/apt-howto/ APT HOWTO] {{Webarchive|url=https://web.archive.org/web/20210309021038/https://www.debian.org/doc/manuals/apt-howto/ |date=2021-03-09 }} |
||
* [https://www.poftut.com/apt-and-apt-get-tutorial-with-examples/ Apt Tutorial] |
* [https://www.poftut.com/apt-and-apt-get-tutorial-with-examples/ Apt Tutorial] |
||
* [https://www.debian.org/doc/manuals/debian-reference/ch02.en.html Chapter 2. Debian package management - Debian Reference] |
* [https://www.debian.org/doc/manuals/debian-reference/ch02.en.html Chapter 2. Debian package management - Debian Reference] |
||
Line 175: | Line 162: | ||
[[Category:Dpkg]] |
[[Category:Dpkg]] |
||
[[Category:Free package management systems]] |
[[Category:Free package management systems]] |
||
[[Category:Free software]] |
|||
[[Category:Free software programmed in C++]] |
[[Category:Free software programmed in C++]] |
||
[[Category:Linux package management-related software]] |
[[Category:Linux package management-related software]] |
||
[[Category:Software update managers]] |
[[Category:Software update managers]] |
||
[[Category:Ubuntu]] |
[[Category:Ubuntu]] |
||
[[Category:Software using the GPL license]] |
Latest revision as of 02:26, 19 December 2024
This article may be too technical for most readers to understand.(December 2024) |
This article may contain an excessive amount of intricate detail that may interest only a particular audience.(December 2024) |
Developer(s) | The Debian Project |
---|---|
Initial release | 31 March 1998[1] |
Stable release | 2.9.17[2]
/ 7 December 2024 |
Repository | |
Written in | C++,[3] shell script,[3] XML,[3] CMake,[3] C,[3] Perl[3] |
Operating system | Unix-like |
Type | Package manager |
License | GPLv2+ |
Website | wiki |
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.[4] 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.[4]
Usage
[edit]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,[by whom?][5][6][7][8] which Debian developers attribute to the strict quality controls in Debian's policy.[9][10]
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
[edit]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
[edit]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 thePackages.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
) anddist-upgrade
(apt-get
), in addition to performing the function ofupgrade
, also intelligently handles changing dependencies with new versions of packages;apt
andapt-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.[4] aptitude has a smarterdist-upgrade
feature calledfull-upgrade
.[11]
Configuration and files
[edit]/etc/apt
contains the APT configuration folders and files.
apt-config
is the APT Configuration Query program.[12] apt-config dump
shows the configuration.[13]
Files
[edit]/etc/apt/sources.list
:[14] 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 "pinning" is specified, 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 insources.list
/var/lib/apt/lists/partial/
: Storage area for state information in transit.
Sources
[edit]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,[update] the Debian project keeps a central repository of over 50,000 software packages ready for download and installation.[15]
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
[16] or adding file:/
URI[17] 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
[edit]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,[18] although graphical front ends often make pinning simpler.
Front ends
[edit]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.[19][20]
- Cydia, a package manager for jailbroken iOS based on APT (ported to iOS as part of the Telesphoreo project).[21][22]
- 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[23]
- 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
[edit]The original effort that led to the apt-get
program was the dselect
replacement project known by its codename Deity.[24] 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).[25]
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.[26]
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.[27]
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.[28]
Variants
[edit]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.[29] The Fink project has ported APT to Mac OS X for some of its own package management tasks,[30] and APT is also available in OpenSolaris.
apt-file
[edit]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.[31]
See also
[edit]References
[edit]- ^ "Initial release". apt package changelog. The Debian project. 31 March 1998. Retrieved 18 December 2021.
- ^ "2.9.17". 7 December 2024. Retrieved 12 December 2024.
- ^ a b c d e f "The apt - Advanced Package Tool Open Source Project on Open Hub: Languages Page". Open Hub. Retrieved 2 May 2024.
- ^ a b c "apt-get(8)". Debian Manpages. Retrieved 18 December 2021.
- ^ Byfield, Bruce (9 December 2004). "An apt-get primer". Retrieved 18 December 2021.
- ^ "From the archives: the best distros of 2000". Tux radar. Archived from the original on 26 July 2020.
- ^ Dorgan, David (19 January 2004). "Migrating to Debian". linux.ie. Archived from the original on 13 May 2006.
- ^ "Mobile Linux development with Familiar and a minimal Debian". Mobile Tux. Archived from the original on 15 September 2008.
- ^ "Why Debian". Retrieved 18 December 2021.
- ^ "Debian policy manual". Retrieved 18 December 2021.
- ^ "Discussion on dist-upgrade vs. full-upgrade". Retrieved 18 December 2021.
- ^ "apt-config(8)". Debian Manpages. Retrieved 18 December 2021.
- ^ "Query APT configuration using apt-config - Debian admin". 2 December 2006. Retrieved 18 December 2021.
- ^ "SourcesList". Debian Wiki. Retrieved 18 December 2021.
- ^ "Debian 11 "bullseye" released". www.debian.org. Retrieved 2022-05-11.
- ^ "apt-cdrom(8)". Debian Manpages. Retrieved 27 December 2021.
- ^ e.g. deb file:/mnt/install stable main contrib non-free.
{{citation}}
: CS1 maint: postscript (link) - ^ "AptConfiguration". Debian Wiki. Retrieved 2020-05-18.
- ^ "AptURL". Ubuntu Wiki. Retrieved 27 December 2021.
- ^ "How to install software in Ubuntu Linux: A complete guide for newbie". 17 June 2018. Retrieved 27 December 2021.
- ^ 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.
- ^ Adhikari, Richard (20 March 2008). "Android, Schmandroid: Linux on the iPhone". LinuxInsider. Retrieved 27 December 2021.
- ^ 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
- ^ White, Brian C. (11 April 1997). ""dselect" replacement project ("deity")". deity@lists.debian.org (Mailing list).
- ^ Gunthorpe, Jason (2 March 1998). "It's working". deity@lists.debian.org (Mailing list).
- ^ Gunthorpe, Jason (19 March 1998). "Re: 2 things (!)". deity@lists.debian.org (Mailing list).
- ^ "A brief history of Debian". debian.org. Archived from the original on 24 August 2003.
- ^ "Secure APT". Debian Wiki. Retrieved 27 December 2021.
- ^ "APT-RPM". apt-rpm.org. Archived from the original on 21 April 2008. Retrieved 27 December 2021.
- ^ "Fink - About". www.finkproject.org. Archived from the original on 11 May 2008. Retrieved 27 December 2021.
- ^ "Inspecting and extracting Debian package contents". Packagecloud blog. 13 October 2015. Retrieved 27 December 2021.
External links
[edit]- Ubuntu package (P3473) (see uses)
- Debian stable package (P3442) (see uses)
- Debian maintenance commands Manual –
- APT HOWTO Archived 2021-03-09 at the Wayback Machine
- Apt Tutorial
- Chapter 2. Debian package management - Debian Reference