Product SiteDocumentation Site

6.8. Udržování aktuálnosti systému

The Debian distribution is dynamic and changes continually. Most of the changes are in the Testing and Unstable versions, but even Stable is updated from time to time, mostly for security-related fixes. Whatever version of Debian a system runs, it is generally a good idea to keep it up to date, so that you can get the benefit of recent evolution and bug fixes.
Jakkoli je samozřejmě možné pravidelně spouštět nástroj pro vyhledávání dostupných aktualizací a spouštět upgrady, může být takový neustále se opakující únavný, hlavně pokud se musí provádět na několika zařízeních. Naštěstí, stejně jako mnoho jiných takových úkolů, může být zčásti zautomatizován a také byla již sada nástrojů za tímto účelem vyvinuta.
Prvním z těchto nástrojů je apticron, v balíčku se stejným jménem. Jeho hlavním účelem je denně spouštět skript (prostřednictvím cron). Skript aktualizuje seznam dostupných balíčků a pokud některé nainstalované balíčky nejsou v nejnovější verzi, pošle email se seznamem těchto balíčků zároveň se změnami, které v těchto nových verzích byly provedeny. Je zřejmé, že je tento balíček určen především uživatelům Debianu, protože denní emaily mohou být velmi dlouhé pro rychleji se měnící verze Debianu. Jakmile jsou aktualizace dostupné, apticron je automaticky stáhne. Nenainstaluje je — administrátor to stále musí udělat — ale s tím, že máte balíčky již stažené a dostupné lokálně (v cache APTu) je úkol rychlejší.
Administrators in charge of several computers will no doubt appreciate being informed of pending upgrades, but the upgrades themselves are still as tedious as they used to be. Periodic upgrades can be enabled: it uses a systemd timer unit or cron. If systemd is not installed, the /etc/cron.daily/apt-compat script (in the apt package) comes in handy. This script is run daily (and non-interactively) by cron. To control the behavior, use APT configuration variables (which are therefore stored in a file /etc/apt/apt.conf.d/10periodic). The main variables are:
APT::Periodic::Update-Package-Lists
Tato volba vám umožní upřesnit četnost (ve dnech), po kterou jsou seznamy balíčků aktualizovány. Uživatelé apticron to mohou udělat bez této proměnné, protože apticron již tento úkol provádí.
APT::Periodic::Download-Upgradeable-Packages
Znovu, tato volba značí četnost (ve dnech), tentokrát pro stahování aktuálních balíčků. A znovu, uživatelé příkazu apticron to nebudou potřebovat.
APT::Periodic::AutocleanInterval
Tato volba pokrývá funkcionalitu, kterou apticron nemá. Ta kontroluje, jak jsou často postarší balíčky (ty, na které již nepoukazuje žádná distribuce) odstraněny z cache APTu. To udržuje APT cache na rozumné velikosti a znamená, že se o tento úkol nemusíte starat.
APT::Periodic::Unattended-Upgrade
When this option is enabled, the daily script will execute unattended-upgrade (from the unattended-upgrades package) which — as its name suggest — can automatize the upgrade process for some packages (by default it only takes care of security updates, but this can be customized in /etc/apt/apt.conf.d/50unattended-upgrades). Note that this option can be set with the help of debconf by running dpkg-reconfigure -plow unattended-upgrades. If apt-listbugs is installed, it will prevent an automatic upgrade of packages which are affected by an already reported serious or grave bug.
Other options can allow you to control the cache cleaning behavior with more precision. They are not listed here, but they are described in the /usr/lib/apt/apt.systemd.daily script.
These tools work very well for servers, but desktop users generally prefer a more interactive system. The package gnome-software provides an icon in the notification area of desktop environments when updates are available; clicking on this icon then runs an interface to perform updates. You can browse through available updates, read the short description of the relevant packages and the corresponding changelog entries, and select whether to apply the update or not on a case-by-case basis.
Upgrade pomocí gpk-update-viewer

Obrázek 6.3. Upgrade pomocí gpk-update-viewer

This tool is no longer installed in the default GNOME desktop. The new philosophy is that security updates should be automatically installed, either in the background or, preferably, when you shutdown your computer so as to not confuse any running application.