Editing APT
Jump to navigation
Jump to search
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.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | Advanced | + | Advanced 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> | + | Main Advanced Package Tool (APT) binaries are: <code>apt</code>, <code>apt-get</code> and <code>apt-cache</code> |
− | == Basic apt commands == | + | == Basic apt-get/apt commands == |
* Installing: <code>apt install PACKAGE_NAME</code> | * Installing: <code>apt install PACKAGE_NAME</code> | ||
− | * <code> | + | * <code>apt show PACKAGE_NAME</code> or <code>aptitude show PACKAGE_NAME</code> |
− | * <code> | + | * <code>apt policy PACKAGE_NAME</code> <ref>https://askubuntu.com/a/347805/897490</ref> Provides source repository for a given package. |
− | * <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> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Basic [[apt-cache]] commands == | == Basic [[apt-cache]] commands == | ||
Line 20: | Line 14: | ||
== Relevant configuration files and directories == | == Relevant configuration files and directories == | ||
− | * <kbd>/etc/apt/ | + | * <kbd>/etc/apt/sources.list</kbd><ref>https://wiki.debian.org/SourcesList</ref>: Configuration files with locations to fetch packages from. |
− | * <kbd> | + | * <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> | + | ** <code>apt list --upgradable</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 && | + | ** <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>[[do-release-upgrade]]</code>) | + | * <code>apt dist-upgrade</code> (see also <code>[[/do-release-upgrade/]]</code>) |
− | * [[ | + | * apt [[/Automatic updates/]] |
− | |||
=== Holding packages === | === Holding packages === | ||
− | To avoid packages from being upgrade when upgrading use <code> | + | To avoid packages from being upgrade when upgrading use <code>apt-mark</code> command |
− | * <code> | + | * <code>apt-mark hold PACKAGE_NAME</code> |
* <code>apt-mark unhold PACKAGE_NAME</code> | * <code>apt-mark unhold PACKAGE_NAME</code> | ||
* <code>apt-mark showhold</code><ref>https://askubuntu.com/questions/640986/how-to-get-a-list-of-installed-packages-held-back-from-upgrade</ref> | * <code>apt-mark showhold</code><ref>https://askubuntu.com/questions/640986/how-to-get-a-list-of-installed-packages-held-back-from-upgrade</ref> | ||
Line 46: | Line 38: | ||
== Activities == | == Activities == | ||
# Read differences between <code>apt upgrade</code> and <code>apt dist-upgrade</code>: https://unix.stackexchange.com/a/304887 | # Read differences between <code>apt upgrade</code> and <code>apt dist-upgrade</code>: https://unix.stackexchange.com/a/304887 | ||
− | # Read [[ | + | # Read [[Linux server administration/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. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== See Also == | == See Also == | ||
− | * | + | * [[dpkg]], [[dnf]] and [[snap]] |
+ | * [[wikipedia:Deb_(file_format)]] to understand ''.deb'' internal format an included files: ''preinst, postinst, prerm and postrm.'' | ||
+ | * [[RPM]] (Linux) | ||
+ | * [[pkgutil]] ([[MacOS]]) | ||
+ | * [[brew]] ([[MacOS]]), command of the [[Homebrew]] package management software [[wikipedia:Homebrew (package management software)]] | ||
+ | * [[pkg]] ([[FreeBSD]]) | ||
+ | * [[wikipedia:apt-file]] to view the contents of [[Debian]] packages on remote repositories | ||
+ | * [[opkg]] | ||
+ | * [[Package manager]] | ||
* {{apt}} | * {{apt}} | ||
− | |||
{{CC license}} | {{CC license}} | ||
Line 66: | Line 57: | ||
[[Category:Server administration]] | [[Category:Server administration]] | ||
+ | [[Category:Operating systems]] | ||
[[Category:Linux]] | [[Category:Linux]] | ||
− | |||
− |
Advertising: