← 返回命令列表

Linux command

apt 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Update

sudo apt update

Search

apt search [package]

Show

apt show [package]

Install

sudo apt install [package]

Remove

sudo apt remove [package]

Upgrade

sudo apt upgrade

Example

apt list --installed

Remove

sudo apt autoremove

说明

apt is the high-level command-line interface for the package management system on Debian-based distributions. It is intended as a user-friendly alternative to apt-get for interactive use with improved defaults and progress display.

参数

update
Download package information from configured sources
upgrade
Install available upgrades without removing packages
full-upgrade
Perform upgrades, removing packages if necessary
install package
Install or upgrade specified packages
remove package
Remove specified packages
purge package
Remove packages and their configuration files
autoremove
Remove packages that were automatically installed but are no longer needed
search pattern
Search for packages matching a pattern
show package
Display package information
list
List packages matching criteria
edit-sources
Edit sources.list files
-y, --yes
Assume yes to prompts
-q, --quiet
Quiet output
--no-install-recommends
Don't install recommended packages

FAQ

What is the apt command used for?

apt is the high-level command-line interface for the package management system on Debian-based distributions. It is intended as a user-friendly alternative to apt-get for interactive use with improved defaults and progress display.

How do I run a basic apt example?

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

What does update do in apt?

Download package information from configured sources