Ubuntu aptitude 命令詳解


“aptitude” 與 apt-get 一樣,是 Debian 及其衍生係統中功能極其強大的包管理工具。

“aptitude” 與 apt-get 不同的是,“aptitude” 在處理依賴問題上更佳一些。

“aptitude” 整閤瞭 dselect 和 apt-get 的所有功能, 並提供的更多特性,特彆是在依賴關係的處理上。

譬如:“aptitude” 在刪除一個包時,會同時刪除本身所依賴的包。這樣的話,係統中不會殘留無用的包,整個係統會更為乾淨。

示例:uname -a

基本語法

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

aptitude [options] <action> ...


注意:

“aptitude” 沒有 Super Cow Powers。

Option 參數
# 參數 EN 解釋 中文翻譯 備注
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 解釋 中文翻譯 備注
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.

詳細用法

功能 # 命令規範 文字解釋 示例 示例解釋
安裝 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 擦除舊的已下載的包文件