Software:APT (Package Manager)
apt-get requesting confirmation before an installation | |
Developer(s) | The Debian Project |
---|---|
Initial release | 31 March 1998[1] |
Stable release | 1.4.9[2]
/ 18 January 2019 |
Preview release | 1.8.0[3]
/ 8 March 2019 |
Written in | C++ |
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, Ubuntu, and related 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
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 of APT 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,[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
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 such distinction is remote repository retrieval of packages. apt uses 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 by 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:
- 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. - dist-upgrade, in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt-get has a "smart" conflict resolution system, and it 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 smarter dist-upgrade feature called full-upgrade.[11]
Configuration and files
/etc/apt
has the apt configuration folders and files.
apt-config is the APT Configuration Query program.[12] apt-config dump
shows the configuration.[13]
Files
/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 you would specify "pinning", 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
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 CDROM location. The Debian project keeps a central repository of over 25,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 discs and other storage media (USB keydrive, hard disks...) can be used as well, using apt-cdrom[15] or adding file:/
[16] to the source list file. Apt-cdrom can specify a different folder 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. Also one can 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 administrators 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
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 freedesktop.org frontend.
- GDebi, a GTK+-based tool sponsored for Ubuntu. (There is also a Qt version, available in the Ubuntu repositories a gdebi-kde.)
- apt-cdrom, a way to add a new CDROM to APT's list of available sources.lists (list of available repositories). 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.[18][19]
- Cydia, a package manager for jailbroken iOS based on APT (ported to iOS as part of the Telesphoreo project).[20][21]
- 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[22]
- 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 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.[1]
- 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.
- 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 replacement project known by its codename deity.[23] This project was commissioned 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 UI.[24]
Much of the original development of APT was done on 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 (UI) was a failure. Work on the UI portion of the project was abandoned (the UI directories were removed from the CVS 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 UIs 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
References
- ↑ "Initial Release". apt package changelog. The Debian Project. 31 March 1998. http://metadata.ftp-master.debian.org/changelogs/main/a/apt/apt_1.4.9_changelog. Retrieved 28 February 2018.
- ↑ "Details of package apt in stretch". Debian Packages. The Debian Project. 18 January 2019. https://packages.debian.org/stable/apt. Retrieved 24 April 2019.
- ↑ "Accepted apt 1.8.0 (source) into unstable". Debian Package Tracker. The Debian Project. 8 March 2019. https://tracker.debian.org/news/1034507/accepted-apt-180-source-into-unstable/. Retrieved 24 April 2019.
- ↑ 4.0 4.1 4.2 "apt-get(8)". https://manpages.debian.org/unstable/apt/apt-get.8.en.html.
- ↑ Byfield, Bruce (2004-12-09). "An apt-get primer". Archived from the original on 2010-04-19. https://www.webcitation.org/5p6i2iySC?url=http://www.linux.com/archive/feed/40745.
- ↑ "From the archives: the best distros of 2000". Tux Radar. http://www.tuxradar.com/content/archives-best-distros-2000.
- ↑ Dorgan, David (2004-01-19). "Migrating to Debian". linux.ie. Archived from the original on 2010-04-19. https://www.webcitation.org/5p6ikqQPs?url=http://www.linux.ie/lists/pipermail/cork/2004-January/003744.html.
- ↑ "Mobile Linux development with Familiar and a minimal Debian". Mobile Tux. http://www.vieka.com/mobiletux/debian.htm.
- ↑ "Why Debian". http://people.debian.org/~srivasta/talks/why_debian/talk.html.
- ↑ "Debian policy manual". http://www.debian.org/doc/debian-policy/.
- ↑ "Discussion on dist-upgrade vs. full-upgrade". http://forums.debian.net/viewtopic.php?f=10&t=39379.
- ↑ "apt-config(8)". https://manpages.debian.org/unstable/apt/apt-config.8.en.html.
- ↑ "Query APT Configuration Using apt-config - Debian Admin". http://www.debianadmin.com/query-apt-configuration-using-apt-config.html.
- ↑ "SourcesList". https://wiki.debian.org/SourcesList.
- ↑ "apt-cdrom(8)". https://manpages.debian.org/unstable/apt/apt-cdrom.8.en.html.
- ↑ e.g. deb file:/mnt/install stable main contrib non-free.
- ↑ "Apt Pinning". Debian Wiki. Archived from the original on 4 October 2006. https://web.archive.org/web/20061004194955/http://wiki.debian.org/AptPreferences. Retrieved 2006-09-19.
- ↑ "AptURL". Ubuntu Wiki. https://wiki.ubuntu.com/AptUrl. Retrieved 16 April 2016.
- ↑ "OzOS | apt:foo". http://cafelinux.org/OzOs/node/3.
- ↑ Jurick, David (2009). iPhone Hacks: Pushing the iPhone and iPod touch Beyond Their Limits. O'Reilly Media, Inc.. p. 20. ISBN 9780596516642. https://books.google.com/books?id=i-gABmh50v8C. Retrieved January 18, 2013.
- ↑ Adhikari, Richard (March 20, 2008). "Android, Schmandroid: Linux on the iPhone". LinuxInsider. http://www.linuxinsider.com/rsstory/62209.html. Retrieved January 18, 2013.
- ↑ Mullikin, Glenn (Dec 2001). "The Evolution of Debian Package Management Systems". AUUGN. 22 (4): 50. ISSN 1035-7521. https://books.google.com/books?id=ColExJoEq1UC&pg=PA50&dq=%22Havoc+Pennington%22. "gnome-apt was written by Havoc Pennington".
- ↑ White, Brian C. (1997-04-11). ""dselect" replacement project ("deity")". deity@lists.debian.org (Mailing list).
- ↑ Gunthorpe, Jason (1998-03-02). "It's working". deity@lists.debian.org (Mailing list).
- ↑ Gunthorpe, Jason (1998-03-19). "Re: 2 things (!)". deity@lists.debian.org (Mailing list).
- ↑ "A Brief History of Debian". Debian.org. https://debian.org/doc/manuals/project-history/ch-detailed.en.html#s4.1.
- ↑ "Secure APT". Debian Wiki. https://wiki.debian.org/SecureApt. Retrieved 2006-09-05.
- ↑ "APT-RPM". apt-rpm.org. Archived from the original on 21 April 2008. https://web.archive.org/web/20080421014529/http://apt-rpm.org/about.shtml. Retrieved 2008-05-12.
- ↑ "Fink - About". www.finkproject.org. Archived from the original on 11 May 2008. https://web.archive.org/web/20080511210043/http://www.finkproject.org/about.php. Retrieved 2008-05-12.
- ↑ "Inspecting and extracting Debian package contents". 2015-10-13. https://blog.packagecloud.io/eng/2015/10/13/inspect-extract-contents-debian-packages/.
External links
- Template:Man/Debian –
- APT HOWTO
- Apt Tutorial
- Chapter 2 .- Debian package management - Debian Reference