Product SiteDocumentation Site

6.5. フロントエンド、aptitudesynaptic

APT is a C++ program whose code mainly resides in the libapt-pkg shared library. Using a shared library facilitates the creation of user interfaces (frontends), since the code contained in the library can easily be reused. Historically, apt-get was only designed as a test frontend for libapt-pkg but its success tends to obscure this fact.

6.5.1. aptitude

aptitude is an interactive program that can be used in semi-graphical mode on the console. You can browse the list of installed and available packages, look up all the available information, and select packages to install or remove. The program is designed specifically to be used by administrators, so that its default behaviors are designed to be much more intelligent than apt-get's, and its interface much easier to understand.
aptitude パッケージマネージャ

図 6.1 aptitude パッケージマネージャ

aptitude は起動すると、状態ごとに分類したパッケージのリストを表示します (インストール済み、未インストール、インストール済みだがミラーから利用不可、タスク、仮想パッケージ、最近ミラーに登場した新しいパッケージなどの状態ごとに分類されます)。さらに、パッケージリストをテーマ別に簡便に閲覧できるビューも用意されています。すべての場合について、aptitude はカテゴリとパッケージを併せたリストを画面に表示します。カテゴリは木構造を使って系統付けられ、木構造の枝は Enter[] キーで開いたり閉じたりできます。+ はインストールマーク、- は削除マーク、_ は完全削除マークをパッケージに対して付け加えるのに使われます (マーク操作はカテゴリに対しても適用できる点に注意してください。この場合、カテゴリ内のすべてのパッケージに対して対応するマーク操作を行います)。u は利用できるパッケージのリストを更新、Shift+u はシステム全体のアップグレードを準備します。g は要求された変更操作の要約ビューに切り替えます (もう一度 g を打てば変更を適用します)。q は現在のビューを閉じます (ビューが一つしか残っていない場合 aptitude を閉じます)。
aptitude でパッケージを検索するには、/ を押して、検索パターンを入力してください。この検索パターンはパッケージの名前に対して検索を行いますが、説明文 (~d を先頭に付けた場合)、セクション (~s)、その他の属性の内容に対してを検索を行うことも可能です。詳しくは文書を参照してください。同じ検索パターンを使って、表示されるパッケージを選別することも可能です。これを行うには、l キー (limit の意味) を押して検索パターンを入力してください。
Managing the “automatic flag” of Debian packages (see 第 6.2.7 節「自動的にインストールされたパッケージの追跡」) is a breeze with aptitude. It is possible to browse the list of installed packages and mark packages as automatic with Shift+m or to remove the mark with the m key. “Automatic packages” are displayed with an “A” in the list of packages. This feature also offers a simple way to visualize the packages in use on a machine, without all the libraries and dependencies that you don't really care about. The related pattern that can be used with l (to activate the filter mode) is ~i!~M. It specifies that you only want to see installed packages (~i) not marked as automatic (!~M).

6.5.1.1. 推奨パッケージ、提案パッケージ、タスクの管理

Another interesting feature of aptitude is the fact that it respects recommendations between packages while still giving users the choice not to install them on a case by case basis. For example, the gnome package recommends transmission-gtk (among others). When you select the former for installation, the latter will also be selected (and marked as automatic if not already installed on the system). Typing g will make it obvious: transmission-gtk appears on the summary screen of pending actions in the list of packages installed automatically to satisfy dependencies. However, you can decide not to install it by deselecting it before confirming the operations.
aptitude を使ってパッケージのアップグレードを行う場合、上で述べた推奨関係を追跡してインストールパッケージを自動選択する機能が作動しない点に注意してください。たとえば、gnome の新バージョンが、以前推奨していなかったパッケージを推奨している場合、推奨されているパッケージは選択されません。しかしながら、管理者がインストールの可否を選択できるように、新しい推奨パッケージはアップグレード画面に表示されます。
さらに、aptitude はパッケージ間の提案関係を考慮しますが、そのやり方はパッケージを特定の表示状態にするだけです。たとえば、gnomeempathy を提案しているので、empathy は保留中の操作の要約画面 (他のパッケージによって提案されたパッケージのセクションの中) に表示されるでしょう。このように、提案されたパッケージは一覧に表示され、管理者はこの提案に従ってインストールするか否かを決めます。パッケージ間の提案関係とは依存関係でも推奨関係でもないので、提案されたパッケージは自動的にインストールマークを付けられません。つまり、ユーザがインストールするか否かを手作業で選択します (このため、提案されたパッケージは自動パッケージとしてマークされません)。
同様の観点から aptitude はタスクの概念をうまく取り扱うことにも触れておきます。タスクはパッケージリストの画面内にカテゴリとして表示されるため、ユーザはタスクのインストールおよび削除を、タスク全体に対して適用するか、タスクのパッケージの一部を選択してそれらに適用するかを選ぶことが可能です。

6.5.1.2. より良い解決アルゴリズム

To conclude this section, let's note that aptitude has more elaborate algorithms compared to apt-get when it comes to resolving difficult situations. When a set of actions is requested and when these combined actions would lead to an incoherent system, aptitude evaluates several possible scenarios and presents them in order of decreasing relevance. However, these algorithms are not fail-proof. Fortunately there is always the possibility to manually select the actions to perform. When the currently selected actions lead to contradictions, the upper part of the screen indicates a number of “broken” packages (and you can directly navigate to those packages by pressing b). It is then possible to manually build a solution for the problems found. In particular, you can get access to the different available versions by simply selecting the package with Enter. If the selection of one of these versions solves the problem, you should not hesitate to use the function. When the number of broken packages gets down to zero, you can safely go to the summary screen of pending actions for a last check before you apply them.

6.5.2. synaptic

synaptic は Debian 用のグラフィカルパッケージマネージャで、GTK+/GNOME を使った簡便で効率的なグラフィカルインターフェースです。数多くのすぐに使えるフィルタのおかげで、新しく利用できるようになったパッケージ、インストール済みパッケージ、アップグレードできるパッケージ、時代遅れのパッケージなどを素早く確認できます。これらのリストを通じてパッケージを閲覧しているならば、閲覧中のパッケージに対して実行する操作 (インストール、アップグレード、削除、完全削除) を選択できます。さらに、これらの操作はすぐに実行されるのではなく、まずは操作リストに追加されます。ボタンを一度クリックするだけで、操作の正当性が検証され、操作は一度に実行されます。
synaptic パッケージマネージャ

図 6.2 synaptic パッケージマネージャ