Product SiteDocumentation Site

6.8. Содержание системы с периодическими обновлениями

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.
Несмотря на то, что есть возможность периодически запускать средства для проверки доступных обновлениий и выполнять загрузку-обновления, такие однотипные постоянно повторяющиеся действия являются скучным и утомительный занятием, особенно в случае выполнения их - на нескольких машинах. К счастью, как и в случае с часто повторяющимися задачами, эту рутинную работу можно частично автоматизировать, и набор средств для этого уже создан.
Первым из этих инструментов является apticron, в пакете с похожим именем. Его основное действие запускать скрипт ежедневно (через cron). Скрипт обновляет перечень доступных пакетов. Если некоторые установленные пакеты не являются последней версией, он посылает email с перечнем тех пакетов, с краткой информацией, что включено в новой версии по каждому пакету. Очевидно, что данный пакет в большинстве случаев рассчитан на пользователей дистибутива Debian Stable, поскольку периодичность обновления в 1 день с информированием по emails не обеспечит быстрой смены версии Debian. Когда обновления станут доступны, apticron автоматически загрузит их. Этот скрипт не устанавливает их, только лишь администратор сможет сделать это, но уже загруженные, и находящиеся в локальном кэше (в кэше APT-а), пакеты намного убыстрят сам процесс обновления пакетов.
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
Эта опция позволит вам определить частоту (в днях) обновления перечня пакетов (доступного на зеркалах). Пользователи программы apticron могут сделать это без этих переменных, так как apticron всегда сама делает зто.
APT::Periodic::Download-Upgradeable-Packages
Похожая на предыдущую, эта опция показывает частоту (в днях) загрузки актуальных пакетов для обновления. И снова пользователи программы apticron не нуждаются в этом.
APT::Periodic::AutocleanInterval
Эта опция имеет возможности, которых нет в apticron. Она контролирует, как часто устаревшие пакеты (те которые больше не относятся ни к каким дистрибутивам) удаляются из кэша APT. Это сохраняет размер кэша APT в разумных размерах и это значит, что вам нет нужды беспокоиться об этом.
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.
Обновление с программой gpk-update-viewer

Рисунок 6.3. Обновление с программой 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.