Ubuntu aptitude Command Explained in Detail

“aptitude” 与 apt-get 一样,是 Debian 及其衍生系统中功能极其强大的包管理工具。

“aptitude” 与 apt-get 不同的是,“aptitude” 在处理依赖问题上更佳一些。

“aptitude” 整合了 dselect 和 apt-get 的所有功能, 并提供的更多特性,特别是在依赖关系的处理上。

譬如:“aptitude” 在删除一个包时,会同时删除本身所依赖的包。这样的话,系统中不会残留无用的包,整个系统会更为干净。

示例:uname -a

Basic Syntax

aptitude [-S fname] [-u|-i]

aptitude [options] <action> ...


“aptitude” 没有 Super Cow Powers。

Option 参数
# 参数 EN 解释 中文翻译 Remark
01 h This help text.
02 --no-gui Do not use the GTK GUI even if available.
03 -s Simulate actions, but do not actually perform them.
04 -d Only download packages, do not install or remove anything.
05 P ways prompt for confirmation of actions.
06 -y Assume that the answer to simple yes/no questions is 'yes'.
07 F forma Specify a format for displaying search results; see the manual.
08 O Specify how search results should be sorted; see the manual.
09 w width Specify the display width for formatting search results.
10 f vely try to fix broken packages.
11 V Show which versions of packages are to be installed.
12 D Show the dependencies of automatically changed packages.
13 Z Show the change in installed size of each package.
14 v Display extra information. (may be supplied multiple times).
15 [release] Set the release from which packages should be installed.
16 q In command-line mode, suppress the incremental progress indicators.
17 key=va Directly set the configuration option named 'key'.
18 with(out)-recomm Specify whether or not to treat recommends as strong dependencies.
19 S fnam Read the aptitude extended status info from fname.
20 -u Download new package lists on startup. (terminal interface only)
21 i Perform an install run on startup. (terminal interface only)
Action 参数
# 参数 EN 解释 中文翻译 Remark
01 insta Install/upgrade packages. 安装/升级 包。
02 mov Remove packages. 移除包。
03 purg Remove packages and their configuration files. 移除包及其配置文件。
04 hold Place packages on hold.
05 unh Cancel a hold command for a package.
06 m Mark packages as having been automatically installed.
07 unmarkau Mark packages as having been manually installed.
08 forbid-v Forbid aptitude from upgrading to a specific package version.
09 upda Download lists of new/upgradable packages. 下载 新/可升级 包列表。
10 fe-up Perform a safe upgrade. 履行安全升级。
11 full-upgra Perform an upgrade, possibly installing and removing packages.
12 p Install the build-dependencies of packages.
13 forget-new Forget what packages are "new".
14 search Search for a package by name and/or expression. 按名称 和/或 表达式搜索包。
15 how Display detailed information about a package. 显示包详细信息。
16 v Displays the versions of specified packages.
17 an Erase downloaded package files. 擦除已下载的包文件。
18 autoclean Erase old downloaded package files. 擦除旧的已下载的包文件。
19 hangelog View a package's changelog.
20 w Download the .deb file for a package.
21 insta Download and (possibly) reinstall a currently installed package.
22 w Show the manually installed packages that require a package, or why one or more packages would require the given package.
23 why-n Show the manually installed packages that lead to a conflict with the given package, or why one or more packages would lead to a conflict with the given package if installed.

Detailed Usage

Function # 命令规范 文字解释 示例 示例解释
安装 01 aptitude install pkgnam 安装/升级 包 pkgnam
移除 01 ptitude remove pkgnam 移除包 pkgnam
清洁移除 01 aptitude purge pkgnam 移除包 pkgname 及其配置文件
更新 01 ptitude up 下载 新/可升级 包列表
升级 01 aptitude upgra 升级可用包
02 aptitude dist-upgra 将系统升级到新发行版
搜索 01 ptitude search pkgnam 按名称 pkgname 搜索包
02 ptitude search exp 按表达式 expression 搜索包
展示 01 aptitude show pkgnam 显示包 pkgname 的详细信息
清理 01 p 擦除已下载的包文件
02 p 擦除旧的已下载的包文件