← 返回命令列表

Linux command

apt-install 命令

安全

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

常用示例

Install

sudo apt install [package]

Example

sudo apt install -V [package]

Example

sudo apt install [package]=[version]

Example

sudo apt install -y [package]

Reinstall

sudo apt install --reinstall [package]

Example

sudo apt install --no-install-recommends [package]

Fix broken

sudo apt install -f

说明

apt install is the standard command for installing packages on Debian-based distributions. It handles dependency resolution, downloads packages from configured repositories, and installs them on the system. If the specified package is already installed, the command will upgrade it to the latest available version. Multiple packages can be specified in a single command.

参数

-y, --yes
Automatic yes to prompts; assume "yes" as answer to all prompts
-V, --verbose-versions
Show full versions for upgraded and installed packages
--reinstall
Reinstall packages even if they are already up-to-date
--no-install-recommends
Do not install recommended packages
-d, --download-only
Download packages but do not install them
-f, --fix-broken
Attempt to correct a system with broken dependencies
-s, --simulate
Simulate the install without making changes
--no-install-suggests
Do not install suggested packages

FAQ

What is the apt-install command used for?

apt install is the standard command for installing packages on Debian-based distributions. It handles dependency resolution, downloads packages from configured repositories, and installs them on the system. If the specified package is already installed, the command will upgrade it to the latest available version. Multiple packages can be specified in a single command.

How do I run a basic apt-install example?

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

What does -y, --yes do in apt-install?

Automatic yes to prompts; assume "yes" as answer to all prompts