| APT(8) | APT | APT(8) |
NAME¶
apt - command-line interface
SYNOPSIS¶
apt [-h] [-o=config_string] [-c=config_file] [-t=target_release] [-a=architecture] {list | search | show | update | install pkg [{=pkg_version_number | /target_release}]... | remove pkg... | upgrade | full-upgrade | edit-sources | {-v | --version} | {-h | --help}}
DESCRIPTION¶
apt provides a high-level commandline interface for the package management system. It is intended as an end user interface and enables some options better suited for interactive usage by default compared to more specialized APT tools like apt-get(8) and apt-cache(8).
Much like apt itself, its manpage is intended as an end user interface and as such only mentions the most used commands and options partly to not duplicate information in multiple places and partly to avoid overwhelming readers with a cornucopia of options and details.
update (apt-get(8))
upgrade (apt-get(8))
When a package is supplied as an argument, the package will be installed prior to the upgrade action.
full-upgrade (apt-get(8))
When a package is supplied as an argument, the package will be installed prior to the upgrade action.
install, reinstall, remove, purge (apt-get(8))
A specific version of a package can be selected for installation by following the package name with an equals (=) and the version of the package to select. Alternatively the version from a specific release can be selected by following the package name with a forward slash (/) and codename (trixie, forky, sid ...) or suite name (stable, testing, unstable). This will also select versions from this release for dependencies of this package if needed to satisfy the request.
Removing a package removes all packaged data, but leaves usually small (modified) user configuration files behind, in case the remove was an accident. Just issuing an installation request for the accidentally removed package will restore its function as before in that case. On the other hand you can get rid of these leftovers by calling purge even on already removed packages. Note that this does not affect any data or configuration stored in your home directory.
autoremove (apt-get(8))
You should check that the list does not include applications you have grown to like even though they were once installed just as a dependency of another package. You can mark such a package as manually installed by using apt-mark(8). Packages which you have installed explicitly via install are also never proposed for automatic removal.
satisfy (apt-get(8))
Example: apt satisfy "foo, bar (>= 1.0)" "Conflicts: baz, fuzz"
why, why-not
The why command determines why an installed package is installed. This provides reasonable feedback as to why an automatically installed package is installed; for a manually installed package no other reason is given. If the package is not installed, no reason can be determined.
The why-not command determines why a package was determined to not be installable. This may not always yield a result, even if a package is uninstallable.
Both commands take a single argument, the name of a package.
search (apt-cache(8))
show (apt-cache(8))
list
edit-sources (work-in-progress)
showsrc, depends, rdepends, policy (summarised in apt-cache(8))
source, build-dep, download, changelog, clean, distclean, autoclean (summarised in apt-get(8))
SCRIPT USAGE AND DIFFERENCES FROM OTHER APT TOOLS¶
The apt(8) commandline is designed as an end-user tool and it may change behavior between versions. While it tries not to break backward compatibility this is not guaranteed either if a change seems beneficial for interactive use.
All features of apt(8) are available in dedicated APT tools like apt-get(8) and apt-cache(8) as well. apt(8) just changes the default value of some options (see apt.conf(5) and specifically the Binary scope). So you should prefer using these commands (potentially with some additional options enabled) in your scripts as they keep backward compatibility as much as possible.
OPTIONS¶
All command line options may be set using the configuration file, the descriptions indicate the configuration option to set. For boolean options you can override the config file by using something like -f-,--no-f, -f=no or several other variations.
-h, --help
-v, --version
--audit
-c, --config-file
-o, --option
--cli-version
Version tracks are presented as follows: The version 3.2 has equivalent versions 0.32, 1.22, and 2.12, implementing new features for their specified major versions.
A special case is the X.9 version pattern: A version like 2.9 is followed by 3.0, but 2.10 follows directly on 2.8; given that we use odd version numbers as development series (2.9 is the 3.0 development series).
This feature has been introduced in APT 3.1.10, and replaces the binary-specific configuration. You may use the APT::Version to similar effect on older binaries, for example, use -o APT::Version=2 to make apt(8) behave like the 2.x series.
The default value is the current APT version for apt(8) and 0.(10 * major + minor) for the classic commands. The 0.X series is soft-deprecated and the other commands will roll over to the 2.x series in the future.
--no-color, --color
SEE ALSO¶
apt-get(8), apt-cache(8), sources.list(5), apt.conf(5), apt-config(8), apt-patterns(7), The APT User's guide in /usr/share/doc/apt-doc/, apt_preferences(5), the APT Howto.
DIAGNOSTICS¶
apt returns zero on normal operation, decimal 100 on error.
BUGS¶
APT bug page[1]. If you wish to report a bug in APT, please see /usr/share/doc/debian/bug-reporting.txt or the reportbug(1) command.
AUTHOR¶
APT team
NOTES¶
- 1.
- APT bug page
| 07 November 2025 | APT 3.1.12 |