Difference between revisions of "APT"
Jump to navigation
Jump to search
(29 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Advanced [[Package manager|Package Tool]], or [[Wikipedia:APT (Debian)|APT]], is a free software user interface that works with core libraries to handle the installation and removal of software on Debian, Ubuntu and other Linux distributions. | Advanced [[Package manager|Package Tool]], or [[Wikipedia:APT (Debian)|APT]], is a free software user interface that works with core libraries to handle the installation and removal of software on Debian, Ubuntu and other Linux distributions. | ||
− | Main Advanced Package Tool (APT) binaries are: <code>apt</code>, <code>[[apt-get]]</code> and <code>[[apt- | + | Main Advanced Package Tool (APT) binaries are: <code>apt</code>, <code>[[apt-get]]</code>, <code>[[apt-cache]]</code> and <code>[[apt-key]]</code> |
− | == Basic | + | == Basic apt commands == |
* Installing: <code>apt install PACKAGE_NAME</code> | * Installing: <code>apt install PACKAGE_NAME</code> | ||
− | * <code>apt show PACKAGE_NAME</code> or <code>aptitude show PACKAGE_NAME</code> | + | * <code>[[apt show]] PACKAGE_NAME</code> or <code>aptitude show PACKAGE_NAME</code> |
− | * <code>apt policy PACKAGE_NAME</code> <ref>https://askubuntu.com/a/347805/897490</ref> Provides source repository for a given package. | + | * <code>[[apt policy]] PACKAGE_NAME</code> <ref>https://askubuntu.com/a/347805/897490</ref> Provides source repository for a given package. |
* <code>[[apt-get]] update && apt-get upgrade</code> | * <code>[[apt-get]] update && apt-get upgrade</code> | ||
* Showing pending to update packages: <code>apt-get upgrade --dry-run</code> or <code>apt-get upgrade -s</code> | * Showing pending to update packages: <code>apt-get upgrade --dry-run</code> or <code>apt-get upgrade -s</code> | ||
** <code>/usr/lib/update-notifier/apt-check --human-readable</code> | ** <code>/usr/lib/update-notifier/apt-check --human-readable</code> | ||
+ | * <code>[[apt purge]]</code> | ||
+ | * <code>[[apt install]]</code> | ||
+ | * <code>[[apt autoremove]]</code> | ||
+ | * <code>[[apt clean]] PACKAGE_NAME</code> | ||
+ | * <code>[[apt-file]] list</code> (<code>apt install apt-file</code>) | ||
+ | * [[apt list]] | ||
== Basic [[apt-cache]] commands == | == Basic [[apt-cache]] commands == | ||
Line 14: | Line 20: | ||
== Relevant configuration files and directories == | == Relevant configuration files and directories == | ||
− | * <kbd>/etc/apt/sources.list</kbd><ref>https://wiki.debian.org/SourcesList</ref>: Configuration files with locations to fetch packages from. | + | * <kbd>/etc/apt/[[sources.list]]</kbd><ref>https://wiki.debian.org/SourcesList</ref>: Configuration files with locations to fetch packages from. |
− | * <kbd>/etc/apt/sources.list.d/</kbd>: directory with additional source list fragments. | + | * <kbd>[[/etc/apt/sources.list.d/]]</kbd>: directory with additional source list fragments. |
== Updates == | == Updates == | ||
* To collect information about what installed packages can be upgraded: | * To collect information about what installed packages can be upgraded: | ||
** <code>[[apt update]]</code> | ** <code>[[apt update]]</code> | ||
− | ** <code>apt list --upgradable</code> | + | ** <code>[[apt list --upgradable]]</code> |
+ | ** <code>[[apt list updated]]</code> | ||
** <code>apt-get upgrade --dry-run</code> or <code>apt-get upgrade -s</code> | ** <code>apt-get upgrade --dry-run</code> or <code>apt-get upgrade -s</code> | ||
− | ** <code>apt update && apt upgrade</code> | + | ** <code>apt update && [[apt upgrade]]</code> |
* To upgrade all installed packages: <code>apt upgrade</code> | * To upgrade all installed packages: <code>apt upgrade</code> | ||
− | * <code>apt dist-upgrade</code> (see also <code>[[ | + | * <code>apt dist-upgrade</code> (see also <code>[[do-release-upgrade]]</code>) |
* [[APT Automatic updates]] | * [[APT Automatic updates]] | ||
+ | * <code>[[apt full-upgrade]]</code> | ||
=== Holding packages === | === Holding packages === | ||
− | To avoid packages from being upgrade when upgrading use <code>apt-mark</code> command | + | To avoid packages from being upgrade when upgrading use <code>[[apt-mark]]</code> command |
* <code>[[apt-mark]] hold PACKAGE_NAME</code> | * <code>[[apt-mark]] hold PACKAGE_NAME</code> | ||
* <code>apt-mark unhold PACKAGE_NAME</code> | * <code>apt-mark unhold PACKAGE_NAME</code> | ||
Line 40: | Line 48: | ||
# Read [[APT Automatic updates]] | # Read [[APT Automatic updates]] | ||
# Install <code>software-properties-common</code> package<ref> https://packages.debian.org/sid/admin/software-properties-common</ref> to be able to use <code>[[apt-add-repository]]</code> Python command available since 2004. | # Install <code>software-properties-common</code> package<ref> https://packages.debian.org/sid/admin/software-properties-common</ref> to be able to use <code>[[apt-add-repository]]</code> Python command available since 2004. | ||
+ | |||
+ | |||
+ | == Related terms == | ||
+ | * <code>[[lsb_release]]</code> | ||
+ | * [[Ansible apt module]] | ||
+ | * <code>[[/etc/apt/apt.conf.d/90forceyes]]</code> | ||
+ | * <code>[[rm -rf]] [[/var/lib/apt/lists/]]*</code> | ||
+ | * <code>[[apt-get source]]</code> | ||
== See Also == | == See Also == | ||
+ | * {{dpkg}} | ||
+ | * {{apt}} | ||
* {{package managers}} | * {{package managers}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
{{CC license}} | {{CC license}} | ||
Line 59: | Line 68: | ||
[[Category:Linux]] | [[Category:Linux]] | ||
[[Category:APT]] | [[Category:APT]] | ||
+ | [[Category:Package managers]] |
Latest revision as of 09:56, 14 March 2024
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 other Linux distributions.
Main Advanced Package Tool (APT) binaries are: apt
, apt-get
, apt-cache
and apt-key
Contents
Basic apt commands[edit]
- Installing:
apt install PACKAGE_NAME
apt show PACKAGE_NAME
oraptitude show PACKAGE_NAME
apt policy PACKAGE_NAME
[1] Provides source repository for a given package.apt-get update && apt-get upgrade
- Showing pending to update packages:
apt-get upgrade --dry-run
orapt-get upgrade -s
/usr/lib/update-notifier/apt-check --human-readable
apt purge
apt install
apt autoremove
apt clean PACKAGE_NAME
apt-file list
(apt install apt-file
)- apt list
Basic apt-cache commands[edit]
apt-cache search
PACKAGE_TO_SEARCHapt-cache policy
[2] List source repository configured included priorities of each source.apt-cache showpkg PACKAGE_NAME
(includes package dependencies)
apt-cache show PACKAGE_NAME
apt-cache depends PACKAGE_NAME
apt-cache rdepends PACKAGE_NAME
apt changelog PACKAGE_NAME
apt-cache madison
Relevant configuration files and directories[edit]
- /etc/apt/sources.list[3]: Configuration files with locations to fetch packages from.
- /etc/apt/sources.list.d/: directory with additional source list fragments.
Updates[edit]
- To collect information about what installed packages can be upgraded:
apt update
apt list --upgradable
apt list updated
apt-get upgrade --dry-run
orapt-get upgrade -s
apt update && apt upgrade
- To upgrade all installed packages:
apt upgrade
apt dist-upgrade
(see alsodo-release-upgrade
)- APT Automatic updates
apt full-upgrade
Holding packages[edit]
To avoid packages from being upgrade when upgrading use apt-mark
command
Single upgrade[edit]
- To upgrade only a package:
apt-get install --only-upgrade PACKAGE_NAME
Activities[edit]
- Read differences between
apt upgrade
andapt dist-upgrade
: https://unix.stackexchange.com/a/304887 - Read APT Automatic updates
- Install
software-properties-common
package[5] to be able to useapt-add-repository
Python command available since 2004.
Related terms[edit]
lsb_release
- Ansible apt module
/etc/apt/apt.conf.d/90forceyes
rm -rf /var/lib/apt/lists/*
apt-get source
See Also[edit]
dpkg, dpkg-query
,update-alternatives
[6],ar
,debsums
,dpkg -V
,dpkg -S
,dpkg -L
,dpkg --configure -a
,wajig
,dpkg -i -E
,dpkg --help, dpkg-source-gitarchive
APT
:wajig
,apt-cache
,add-apt-repository
PPA,apt
[install
|remove
|purge | show | list | changelog
|update
|upgrade
],do-release-upgrade
,apt-mark
,apt full-upgrade
,sources.list
, APT Automatic updates,unattended-upgrade
,apt-transport-https
,apt-get update
,/etc/apt/
,/etc/apt/apt.conf.d/50unattended-upgrades
,/etc/apt/apt.conf.d/
,/etc/apt/apt.conf.d/20auto-upgrades
,apt-file, apt-utils
- Package managers: dpkg, APT, RPM, YUM, DNF, homebrew, pkgutil, opkg, Helm, pkg and snap, npm, Aptitude, alien, Conan, CRAN, Chocolatey, NuGet, PackageKit, Wajig, pacman, PIP, Apache Ivy, List packages, List files in packages, Spack
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.
Original Source: https://en.wikiversity.org/wiki/Linux_server_administration/apt
- ↑ https://askubuntu.com/a/347805/897490
- ↑ http://manpages.ubuntu.com/manpages/xenial/man8/apt-cache.8.html#options
- ↑ https://wiki.debian.org/SourcesList
- ↑ https://askubuntu.com/questions/640986/how-to-get-a-list-of-installed-packages-held-back-from-upgrade
- ↑ https://packages.debian.org/sid/admin/software-properties-common
- ↑ https://linux.die.net/man/8/update-alternatives
Advertising: