Product SiteDocumentation Site

6.8. Ein System aktuell halten

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.
Natürlich ist es möglich, regelmäßig ein Programm auszuführen, das nach verfügbaren Aktualisierungen sucht und diese installiert. Allerdings ist eine solch wiederkehrende Aufgabe mühsam, speziell dann, wenn sie auf vielen Maschinen ausgeführt werden muss. Glücklicherweise lassen sich solch lästige Aufgaben teilweise automatisieren, eine Reihe von Werkzeugen dazu wurde bereits entwickelt.
Das erste dieser Werkzeuge ist apticron im Paket gleichen Namens. Seine Hauptaufgabe ist, täglich ein Skript (via cron) auszuführen. Das Skript aktualisiert die Liste der verfügbaren Pakete und schickt, falls ein installiertes Paket nicht in der aktuellsten Version vorliegt, eine E-Mail mit der Liste dieser Pakete zusammen mit den Änderungen in den neuen Versionen. Offenkundig richtet sich dieses Paket an Anwender von Debian Stable, da tägliche E-Mails für die sich häufiger ändernden Versionen von Debian doch sehr lang würden. Sind Aktualisierungen verfügbar, lädt apticron sie automatisch herunter. Es installiert sie nicht – das ist dem Administrator überlassen – aber dass die Pakete bereits heruntergeladen und lokal verfügbar (im Zwischenspeicher von APT) sind, beschleunigt die Aufgabe.
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
Diese Option erlaubt es Ihnen, die Frequenz (in Tagen) festzulegen mit der die Paketlisten aktualisiert werden. Anwender von apticron benötigen diese Variable nicht, da apticron diese Aufgabe selbst übernimmt.
APT::Periodic::Download-Upgradeable-Packages
Auch diese Option legt die Frequenz (in Tagen) fest, diesmal für das Herunterladen der Pakete. Und wieder benötigen Anwender von apticron sie nicht.
APT::Periodic::AutocleanInterval
Die Option deckt ein Merkmal ab, über das apticron nicht verfügt. Sie bestimmt, wie häufig veraltete Pakete (die von keiner Veröffentlichung mehr referenziert werden) aus dem Zwischenspeicher von APT entfernt werden. Dies hält den Zwischenspeicher von APT auf einer sinnvollen Größe und entlastet Sie davon, sich Gedanken um diese Aufgabe machen zu müssen.
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.
Aktualisieren mit gpk-update-viewer

Abbildung 6.3. Aktualisieren mit 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.