Product SiteDocumentation Site

6.5. Frontends: 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 (front-ends), since the code contained in the library can easily be reused. Historically, apt-get was only designed as a test front-end 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.
Balíčkový manažer aptitude

Obrázek 6.1. Balíčkový manažer 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.
K vyhledávání balíčku můžete napsat / za který se napíše vyhledávací schéma. Toto schéma odpovídá jménu balíčku, ale může být uplatněno také pro popis (pokud před něj napíšete ~d), pro sekci (prostřednictvím ~s) nebo pro jiné charakteristiky popsané v dokumentaci. Stejné schéma může filtrovat seznam zobrazených balíčků: stiskněte klávesu l (jako pro limit) a zadejte schéma.
Řízení “automatického návěstí (flagu)” balíčků Debianu (viz. 6.2.7 – „Sledování automaticky nainstalovaných balíčků“) je s aptitude hračka. Je možné procházet seznam nainstalovaných balíčků a označovat balíčky za automatické pomocí Shift+m nebo odstranit označení prostřednictvím klávesy m. “Automatické balíčky” jsou zobrazeny s “A” na seznamu balíčků. Tato funkcionalita také nabízí jednoduchý způsob, jak se podívat na balíčky, které se na zařízení používají, bez veškerých knihoven a závislostí, které vás doopravdy nezajímají. Související schéma, které může být použito s l (pro aktivaci filtrovacího módu) je ~i!~M. To upřesňuje to, že chcete vidět pouze nainstalované balíčky (~i), které nejsou označeny jako automatické (!~M).

6.5.1.1. Doporučení k řízení, návrhy a úkoly

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.
Mějte na paměti, že tato doporučující sledovací funkcionalita se neuplatňuje na upgrady. Například, pokud nová verze gnome doporučuje balíček, který dříve nedoporučoval, balíček nebude označen k instalaci. Každopádně, bude vypsán na obrazovku upgradu, takže administrátor jej může stále vybrat k instalaci.
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).
V tom samém duchu, pamatujte, že aptitude inteligentně používá koncept úkolů. Protože jsou úkoly zobrazeny jako kategorie na obrazovce seznamů balíčků, můžete buď vybrat celý úkol k instalaci nebo odstranění nebo projít seznam balíčků obsažených v úkolu a vybrat tak menší část.

6.5.1.2. Algoritmus lepšího řešitele

Abychom završili tuto sekci, uvědomte si, že aptitude má více propracovaný algoritmus v porovnání s apt-get když přijde na řešení obtížných situací. Jakmile je vyžadován soubor akcí a jakmile by tyto zkombinované akce vedly k nekonzistentnímu systému, aptitude vyhodnotí různé možné scénáře a předloží je v pořadí sestupné důležitosti. Každopádně algoritmy nejsou neomylné. Naštěstí je tu vždy možnost manuálně vybrat akci, která se provede. Pokud současně vybrané akce vedou k rozporům, horní část obrazovky ukáže počet “pokažených” balíčků (můžete se na ně ihned přemístit stiskem b). Možné je potom manuálně sestavit řešení pro nalezené problémy. Konkrétně, můžete si zpřístupnit různé verze jednoduše tím, že vyberete balíček pomocí klávesy Enter. Pokud výběr jedné z těchto verzí vyřeší problém, neměli by jste váhat tuto funkci použit. Jakmile počet pokažených balíčků klesne na nule, můžete bezpečně přejít na obrazovku přehledu nedokončených akcí kvůli poslední kontrole před jejich provedením.

6.5.2. synaptic

synaptic je grafický balíčkový manažer pro Debian, který se chlubí jasným a efektivním grafickým rozhraním založeným na GTK+/GNOME. Jeho velké množství před připravených filtrů poskytuje rychlý přístup k nově dostupným balíčkům, nainstalovaným balíčkům, zastaralým balíčkům apod. Pokud si projdete tyto seznamy, můžete vybrat operace, které mají být na balíčcích provedeny (instalace, upgrade, odstranění, vyčištění); tyto operace se hned neprovedou, ale jsou dány na seznam úkolů. Jeden jediný klik na tlačítko potom potvrdí operace a ty jsou poté provedeny najednou.
synaptic balíčkový manažer

Obrázek 6.2. synaptic balíčkový manažer