Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
APT (software)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==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 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,{{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. ===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, <code>libc6</code> would be the argument provided, not <code>libc6_1.9.6-2.deb</code>). 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 (<code>/etc/apt/sources.list</code>) 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 <code>apt_preferences</code> 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. [[dpkg|Triggers]] are the treatment of deferred actions. ===Update, upgrade and dist-upgrade=== Usage modes of <code>apt</code> and <code>apt-get</code> that facilitate updating installed packages include: * <code>update</code> is used to resynchronize the '''package index''' files from their sources. The lists of available packages are fetched from the location(s) specified in <code>/etc/apt/sources.list</code>. For example, when using a Debian archive, this command retrieves and scans the <code>Packages.gz</code> files, so that information about new and updated packages is available. * <code>upgrade</code> is used to install the newest versions of all packages currently installed on the system from the sources enumerated in <code>/etc/apt/sources.list</code>. 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. * <code>full-upgrade</code> (<code>apt</code>) and <code>dist-upgrade</code> (<code>apt-get</code>), in addition to performing the function of <code>upgrade</code>, also intelligently handles changing dependencies with new versions of packages; <code>apt</code> and <code>apt-get</code> 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 <code>/etc/apt/sources.list</code> file contains a list of locations from which to retrieve desired package files.<ref name="manpage"/> [[aptitude (software)|aptitude]] has a smarter <code>dist-upgrade</code> feature called <code>full-upgrade</code>.<ref>{{cite web|url=http://forums.debian.net/viewtopic.php?f=10&t=39379|title=Discussion on dist-upgrade vs. full-upgrade|access-date=18 December 2021}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)