Product SiteDocumentation Site

6.5. Графические оболочки: aptitude, synaptic

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.
The aptitude менеджер пакетов

Рисунок 6.1. The aptitude менеджер пакетов

When it starts, aptitude shows a list of packages sorted by state (installed, non-installed, or installed but not available on the mirrors — other sections display tasks, virtual packages, and new packages that appeared recently on mirrors). To facilitate thematic browsing, other views are available. In all cases, aptitude displays a list combining categories and packages on the screen. Categories are organized through a tree structure, whose branches can respectively be unfolded or closed with the Enter, [ and ] keys. + should be used to mark a package for installation, - to mark it for removal and _ to purge it (note that these keys can also be used for categories, in which case the corresponding actions will be applied to all the packages of the category). u updates the lists of available packages and Shift+u prepares a global system upgrade. g switches to a summary view of the requested changes (and typing g again will apply the changes), and q quits the current view. If you are in the initial view, this will effectively close 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.
Запомни, что эта рекомендованная трассирующая (отслеживающая) возможность не применяется к обновлениям (upgrade). Для примера, если новая версия gnome рекомендует пакет, что ранее не рекомендовала, пакет не будет отмечен к установке. Однако это будет показано на предварительном просмотре на экране при обновлении и администратор сможет сам отметить данный пакет к установке (если в нем есть необходимость).
Suggestions between packages are also taken into account, but in a manner adapted to their specific status. For example, since gnome suggests empathy, the latter will be displayed on the summary screen of pending actions (in the section of packages suggested by other packages). This way, it is visible and the administrator can decide whether to take the suggestion into account or not. Since it is only a suggestion and not a dependency or a recommendation, the package will not be selected automatically — its selection requires a manual intervention from the user (thus, the package will not be marked as automatic).
В том же духе, вспомните 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 менеджер пакетов