← 返回命令列表

Linux command

apt-list 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List all packages

apt list

Example

apt list --installed

Example

apt list --upgradable

Example

apt list --all-versions

Example

apt list "[nginx*]"

Example

apt list --installed "[python3-*]"

说明

apt list displays a list of packages tracked by the APT package manager. By default, it prints every package known to the configured sources, marking each line with the package name, version, architecture, and a status tag such as installed, installed,automatic, or upgradable from: .... The command accepts one or more shell-style patterns to filter the output by package name. Filters can be combined with --installed, --upgradable, or --manual-installed to narrow results to a specific state. Output is meant for interactive consumption and may change between releases. For scripted use APT prints a warning to stderr; redirect stderr or use dpkg-query / apt-cache pkgnames when stable output is required.

参数

--installed
Show only packages currently installed on the system.
--upgradable
Show only installed packages for which a newer version is available.
--manual-installed
Show only packages that were installed explicitly (not as a dependency).
--all-versions
Show every available version of each package, not just the candidate.
-v, --verbose
Print additional details such as the source repository.
-q, --quiet
Suppress progress indicators; quieter output suitable for logs.
-o _OPTION=VALUE_
Set an arbitrary APT configuration option for this invocation.

FAQ

What is the apt-list command used for?

apt list displays a list of packages tracked by the APT package manager. By default, it prints every package known to the configured sources, marking each line with the package name, version, architecture, and a status tag such as installed, installed,automatic, or upgradable from: .... The command accepts one or more shell-style patterns to filter the output by package name. Filters can be combined with --installed, --upgradable, or --manual-installed to narrow results to a specific state. Output is meant for interactive consumption and may change between releases. For scripted use APT prints a warning to stderr; redirect stderr or use dpkg-query / apt-cache pkgnames when stable output is required.

How do I run a basic apt-list example?

Run `apt list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --installed do in apt-list?

Show only packages currently installed on the system.