简介
Aptitude 是一个基于 Ncurses 的 Apt 前端,debian 软件包管理器。既然它是基于文本的,从就要从终端或命令行(CLI,命令行界面)下启动。Aptitude 有很多有用的功能,包括:
- a mutt-like syntax for matching packages in a flexible manner
mark packages as "automatically installed" or "manually installed" so that packages can be auto-removed when no longer required
- 动作彩色预览
- dselect-like persistence of user actions
- the ability to retrieve and display the Debian changelog of most packages
AptCLI-like (= apt-get + apt-cache) command line mode ("aptitude install foo")
- Score-based and (usually) smarter dependency resolver than apt-get
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:
aptitude
运行后,使用:
- F10 可访问菜单和使用 aptitude。这个是主要按键。
- ? (问号)查看帮助
- '↑'、'↓'、'←'、'→' 4个方向键用来导航。
- '回车键'用来选择
- '+' 或 '-' 键可安装/更新或移除软件包
- The 'g' key to preview/confirm actions
- 'q' 键退出 – 也可关闭当前打开的窗口 (‘g’ 键前进,‘q’ 键返回)
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:
- 'a' explicitly accepts an action (use again to unaccept)
- 'r' rejects an action
- 'g' again goes ahead with 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.
- 查看您当前运行的 Debian 版本:
$ 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))'
另见
- 手册 : /usr/share/doc/aptitude/README
在线参考手册(html) : http://algebraicthunk.net/~dburrows/projects/aptitude/doc/en/ (如果您安装了 aptitude-doc-en,可查看 本地副本)
and ... apt.conf, preferences, sources.list, Aptitude::Parse-Description-Bullets=true, AptitudeTodo
?CategoryQuickPackageManagement