Translation(s): English - Español - Français - Русский - Italiano- 简体中文

(!) ?Discussion


aptitude is also non-fattening, naturally cleansing, and housebroken. It does not, however, have Super Cow Powers, meaning that it does not implement the moo operation, verbosely or otherwise.

软件包是 aptitude

aptitude 手册真是一个金矿啊。我不想再重复相关内容,请移步手册吧~~


terminal 输入下面命令,启动 aptitude:



The common use of aptitude in TUI (text user interface) is; run aptitude; press 'u' (update the lists of available packages); press 'U' (Mark all upgradable packages to be upgraded); (search/select some stuff to install, is optional); press 'g' (to see the pending actions and modify if needed); press 'g' (again, to start the download).

Some time when you need to resolve conflicts, you discover that you made a mistake; you can easily use 'Cancel pending actions' in the 'Actions' menu so that you can re-select.

When reviewing pending actions:

查看 获取软件包信息 for understanding the letters in the package synopsis line (e.g., 'i' means "will be installed", 'p' means "not installed", etc.)


下面的 aptitude 操作和 apt-get 一样:


# aptitude update


# aptitude safe-upgrade

安装软件包(以 foo 为例):

# aptitude install foo

移除软件包(以 bar 为例):

# aptitude remove bar

卸载软件包并清除配置(以 foo 为例):

# aptitude purge foo


搜索包含 foo 的软件包:

$ aptitude search foo

Personally, I still use apt-cache search foo to perform a search – aptitude search foo is slower. But you should try the aptitude search foo way. You should discover that the output is a bit different from apt-cache, in some case, it may be useful to search for a package to see if it is already installed.

showing if a specific package is installed :

$ aptitude show foo


从一个稳定版本升级到下一个版本(例如,从 Lenny 到 Squeeze)可按照相关 架构发行注记 进行。对多数使用 32 位系统的来说,可按照Intel x86 发行注记。64 位系统就是AMD64 发行注记

Using full-upgrade in the regular course of events no longer the recommended practice (unless you are running sid, in which case you should not need to be reading this.)

Minor release upgrades (e.g. from lenny 5.0.1 to 5.0.2) and security updates are done with safe-upgrade.

$ cat /etc/debian_version

例如从 etch 4.0r1 升级到 4.0r2,或应用安全升级:

# aptitude update
# aptitude safe-upgrade

从 apt-get 到 aptitude

提示:该列表为 apt-get、aptitude 部分操作命令对比。下表中的 foo 代表软件包名称


apt-get 命令

aptitude 命令

安装 foo

apt-get install foo

aptitude install foo

搜索 foo

apt-cache search foo

aptitude search foo

删除 foo

apt-get remove foo

aptitude remove foo


apt-cache rdepends foo

aptitude search ~Dfoo

输出 foo 的优先级信息

apt-cache policy foo

aptitude versions foo

下载 foo 源码并构建二进制 .deb 软件包

apt-get source --compile foo



Looking for packages installed from anything else than stable:

aptitude search '?narrow(?installed, !?archive(stable))'

Looking for packages installed from testing (assuming you have sources lists with stable and testing repositories):

aptitude search '?narrow(?installed, ?archive(testing) !?archive(stable))'


and ... apt.conf, preferences, sources.list, Aptitude::Parse-Description-Bullets=true, AptitudeTodo