Unattended Upgrades: Unterschied zwischen den Versionen

Aus Foxwiki
Die Seite wurde neu angelegt: „== Unattended Upgrades == The purpose of [https://packages.debian.org/unattended-upgrades unattended-upgrades] is to keep the computer current with the latest security (and other) updates automatically If you plan to use it, you should have some means to monitor your systems, such as installing the [https://packages.debian.org/apt-listchanges apt-listchanges] package and configuring it to send you emails about updates. And there is always <tt>/var/log/dp…“
 
K Textersetzung - „= Bekannte Probleme =“ durch „= Problembehebung =“
 
(34 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
== Unattended Upgrades ==
'''Unattended Upgrades''' - Unbeaufsichtigte Upgrades
The purpose of [https://packages.debian.org/unattended-upgrades unattended-upgrades] is to keep the computer current with the latest security (and other) updates automatically


If you plan to use it, you should have some means to monitor your systems, such as installing the [https://packages.debian.org/apt-listchanges apt-listchanges] package and configuring it to send you emails about updates. And there is always <tt>/var/log/dpkg.log</tt>, or the files in <tt>/var/log/unattended-upgrades/</tt>
== Beschreibung ==
Computer automatisch mit den neuesten Sicherheits- (und anderen) Updates auf dem neuesten Stand zu halten
* Wenn Sie es verwenden möchten, sollten Sie über Möglichkeiten zur Überwachung Ihrer Systeme verfügen, z. B. durch die Installation des Pakets [https://packages.debian.org/apt-listchanges apt-listchanges] und dessen Konfiguration
* sodass Sie E-Mails über Aktualisierungen erhalten


As of Debian 9 (Stretch) both the <tt>unattended-upgrades</tt> and <tt>apt-listchanges</tt> packages are installed by default and upgrades are enabled with the GNOME desktop. Rudimentary configuration is accessible via the "Software & Updates" application ([https://packages.debian.org/software-properties-gtk software-properties-gtk])
== Ändern von Download- und Upgrade-Zeitplänen (auf systemd) ==
Da Debian [https://wiki.debian.org/systemd systemd] verwendet, werden systemd [https://manpages.debian.org/man/systemd.timer.5 timers] verwendet, um regelmäßige APT-Wartungsaufgaben auszuführen.


To install these packages, run the following command as root
Diese Dateien werden vom [https://packages.debian.org/apt apt]-Paket bereitgestellt
 
Die relevanten Dateien sind
* Für „Downloads“ verwendet: <tt>/lib/systemd/system/apt-daily.timer</tt>
** wird überschrieben durch <tt>/etc/systemd/system/apt-daily.timer.d/override.conf</tt>
* Für „Upgrades“ verwendet: <tt>/lib/systemd/system/apt-daily-upgrade.timer</tt>
** wird überschrieben durch <tt>/etc/systemd/system/apt-daily-upgrade.timer.d/override.conf</tt>
 
Die offiziellen Schritte zum Erstellen und Bearbeiten dieser Überschreibungen für diese Einstellungen sind für „Downloads“
sudo systemctl edit apt-daily.timer
sudo systemctl restart apt-daily.timer
sudo systemctl status apt-daily.timer
 
3. optional, you can check the next trigger time with this)
 
or for '''upgrades'''
sudo systemctl edit apt-daily-upgrade.timer
sudo systemctl restart apt-daily-upgrade.timer
sudo systemctl status apt-daily-upgrade.timer (optional, you can check the next trigger time with this)
 
Hier ist ein Beispiel dafür, wie Sie die „Downloadzeit“ auf 1 Uhr morgens setzen können, indem Sie Folgendes über <tt>sudo systemctl edit apt-daily.timer</tt> hinzufügen
[Timer]
OnCalendar==
OnCalendar=01:00
RandomizedDelaySec=0
 
Zeile 2 oben wird benötigt, um den unten in Zeile 5 angezeigten Standardwert zurückzusetzen (zu leeren). Zeile 4 oben wird benötigt, um zufällige Verzögerungen durch die Standardwerte zu verhindern
 
Die aktuellen Standardwerte für Downloads sind <tt>/lib/systemd/system/apt-daily.timer</tt> (zum Zeitpunkt des Schreibens dieses Artikels)
[Unit]
Description=Daily apt download activities
[Timer]
OnCalendar=*-*-* 6,18:00
RandomizedDelaySec=12h
Persistent=true
[Install]
WantedBy=timers.target
 
== Installation ==
Ab Debian 9 (Stretch) sind sowohl die Pakete <tt>unattended-upgrades</tt> als auch <tt>apt-listchanges</tt> standardmäßig installiert und Upgrades sind mit dem GNOME-Desktop
 
Um diese Pakete zu installieren, führen Sie den folgenden Befehl als root aus
  apt-get install unattended-upgrades apt-listchanges
  apt-get install unattended-upgrades apt-listchanges


The default configuration file for the <tt>unattended-upgrades</tt> package is at <tt>/etc/apt/apt.conf.d/50unattended-upgrades</tt>. Any local customizations should be in <tt>/etc/apt/apt.conf.d/52unattended-upgrades-local</tt> (see package README for details). * editor /etc/apt/apt.conf.d/52unattended-upgrades-local
== Syntax ==
<syntaxhighlight lang="bash" highlight="1" line>
 
</syntaxhighlight>
=== Optionen ===
=== Parameter ===
=== Umgebungsvariablen ===
=== Exit-Status ===
== Anwendung ==
=== Manueller Start (zur Fehlerbehebung) ===
Um die Fehlerbehebung zu unterstützen, müssen Sie möglicherweise unbeaufsichtigte Upgrades manuell ausführen.
sudo unattended-upgrade -d
 
=== Problembehebung ===
 
== Konfiguration ==
=== Dateien ===
Die Standardkonfigurationsdatei für das Paket <tt>„unattended-upgrades“</tt> befindet sich unter <tt>/etc/apt/apt.conf.d/50unattended-upgrades</tt>
* Alle lokalen Anpassungen sollten sich unter <tt>/etc/apt/apt.conf.d/52unattended-upgrades-local</tt> befinden (weitere Informationen finden Sie in der README-Datei des Pakets)
editor /etc/apt/apt.conf.d/52unattended-upgrades-local


This section controls which packages are upgraded
In diesem Abschnitt wird gesteuert, welche Pakete aktualisiert werden
  Unattended-Upgrade::Origins-Pattern {
  Unattended-Upgrade::Origins-Pattern {
     // ..
     // ..
  };
  };


You should at least uncomment the following line
Sie sollten zumindest die folgende Zeile auskommentieren
  Unattended-Upgrade::Mail "root";
  Unattended-Upgrade::Mail "root";


=== Automatic call via /etc/apt/apt.conf.d/20auto-upgrades ===
=== Automatischer Aufruf über /etc/apt/apt.conf.d/20auto-upgrades ===
To activate <tt>unattended-upgrades</tt>, you need to ensure that the apt configuration stub <tt>/etc/apt/apt.conf.d/20auto-upgrades</tt> contains at least the following lines
Um <tt>unbeaufsichtigte Upgrades</tt> zu aktivieren, müssen Sie sicherstellen, dass die apt-Konfigurationsdatei <tt>/etc/apt/apt.conf.d/20auto-upgrades</tt> mindestens die folgenden Zeilen enthält
  editor /etc/apt/apt.conf.d/20auto-upgrades
  editor /etc/apt/apt.conf.d/20auto-upgrades
  APT::Periodic::Update-Package-Lists "1";
  APT::Periodic::Update-Package-Lists "1";
  APT::Periodic::Unattended-Upgrade "1";
  APT::Periodic::Unattended-Upgrade "1";


The file <tt>/etc/apt/apt.conf.d/20auto-upgrades</tt> can be created manually or by running the following command as root
Die Datei <tt>/etc/apt/apt.conf.d/20auto-upgrades</tt> kann manuell erstellt werden oder indem der folgende Befehl als root ausgeführt wird
  dpkg-reconfigure unattended-upgrades
  dpkg-reconfigure unattended-upgrades


Or non-interactively by running
Oder nicht interaktiv durch Ausführen
  echo unattended-upgrades unattended-upgrades/enable_auto_updates boolean true | debconf-set-selections
  echo unattended-upgrades unattended-upgrades/enable_auto_updates boolean true | debconf-set-selections
  dpkg-reconfigure -f noninteractive unattended-upgrades
  dpkg-reconfigure -f noninteractive unattended-upgrades


=== Automatic call via /etc/apt/apt.conf.d/02periodic ===
=== Automatischer Aufruf über /etc/apt/apt.conf.d/02periodic ===
'''Alternatively''', you can also create the apt configuration file <tt>/etc/apt/apt.conf.d/02periodic</tt> to activate <tt>unattended-upgrades</tt>
„Alternativ“ können Sie auch die apt-Konfigurationsdatei <tt>/etc/apt/apt.conf.d/02periodic</tt> erstellen, um <tt>unattended-upgrades</tt> zu aktivieren.
  editor /etc/apt/apt.conf.d/02periodic
  editor /etc/apt/apt.conf.d/02periodic


Below is an example <tt>/etc/apt/apt.conf.d/02periodic</tt>
Unten sehen Sie ein Beispiel <tt>/etc/apt/apt.conf.d/02periodic</tt>
// Control parameters for cron jobs by /etc/cron.daily/apt-compat  
// Control parameters for cron jobs by /etc/cron.daily/apt-compat  
  //
  //
  // Enable the update/upgrade script (0=disable)
  // Enable the update/upgrade script (0=disable)
Zeile 63: Zeile 128:
  //    3:  + trace on
  //    3:  + trace on
  APT::Periodic::Verbose "2";
  APT::Periodic::Verbose "2";
<noinclude>


=== Manual run (for debugging) ===
== Anhang ==
To aid debugging you may need to run unattended-upgrades manually thus
=== Siehe auch ===
 
{{Special:PrefixIndex/{{BASEPAGENAME}}}}
sudo unattended-upgrade -d


=== See Also ===
==== Dokumentation ====
* <tt>/usr/share/doc/unattended-upgrades/README.md.gz</tt>
* <tt>/usr/share/doc/unattended-upgrades/README.md.gz</tt>
* <tt>/usr/share/doc/apt/examples/configure-index</tt>
* <tt>/usr/share/doc/apt/examples/configure-index</tt>
* <tt>/etc/cron.daily/apt</tt>
* <tt>/etc/cron.daily/apt</tt>
===== Man-Pages =====
* [https://manpages.debian.org/man/apt.conf.5 man apt.conf(5)]
* [https://manpages.debian.org/man/apt.conf.5 man apt.conf(5)]
* [https://manpages.debian.org/man/unattended-upgrade.8 man unattended-upgrade(8)]
* [https://manpages.debian.org/man/unattended-upgrade.8 man unattended-upgrade(8)]
* [https://packages.debian.org/search?keywords=needrestart needrestart*] packages, to identify additional running processes which must be restarted to apply (previously installed security) updates without rebooting
== apt-listchanges ==
Below is an example configuration file for [https://packages.debian.org/apt-listchanges apt-listchanges], <tt>/etc/apt/listchanges.conf</tt>
$EDITOR /etc/apt/listchanges.conf
[apt]
frontend=pager
email_address=root
confirm=0
save_seen=/var/lib/apt/listchanges.db
which=both
== Modifying download and upgrade schedules (on systemd) ==
Because Debian is using [https://wiki.debian.org/systemd systemd], it uses systemd [https://manpages.debian.org/man/systemd.timer.5 timers] to run periodic APT maintenance tasks. These files are provided by the [https://packages.debian.org/apt apt] package
The relevant files are: * Used for '''downloads''': <tt>/lib/systemd/system/apt-daily.timer</tt>
** gets overridden by <tt>/etc/systemd/system/apt-daily.timer.d/override.conf</tt>
* Used for '''upgrades''': <tt>/lib/systemd/system/apt-daily-upgrade.timer</tt>
** gets overridden by <tt>/etc/systemd/system/apt-daily-upgrade.timer.d/override.conf</tt>


The canonical steps to create and edit these overrides for these settings are for '''downloads''' * sudo systemctl edit apt-daily.timer
===== Info-Pages =====
sudo systemctl restart apt-daily.timer
==== Links ====
sudo systemctl status apt-daily.timer (optional, you can check the next trigger time with this)
===== Projekt =====
or for '''upgrades'''
[https://packages.debian.org/search?keywords=needrestart needrestart]-Pakete, um zusätzliche laufende Prozesse zu identifizieren, die neu gestartet werden müssen, um (zuvor installierte Sicherheits-)Updates ohne Neustart anzuwenden
sudo systemctl edit apt-daily-upgrade.timer
sudo systemctl restart apt-daily-upgrade.timer
sudo systemctl status apt-daily-upgrade.timer (optional, you can check the next trigger time with this)
 
Here is an example of how to override the '''download time''' to 1AM by adding the following via <tt>sudo&nbsp;systemctl&nbsp;edit&nbsp;apt-daily.timer</tt>
 
[Timer]
OnCalendar==
OnCalendar=01:00
RandomizedDelaySec=0
 
Line #2 above is needed to '''reset''' (empty) the default value shown below in line #5.Line #4 above is needed to prevent any random delays coming from the defaults
 
The current default values for downloads are <tt>/lib/systemd/system/apt-daily.timer</tt> is (at moment of this writing)
 
[Unit]
Description=Daily apt download activities
[Timer]
OnCalendar=*-*-* 6,18:00
RandomizedDelaySec=12h
Persistent=true
[Install]
WantedBy=timers.target


[https://wiki.debian.org/CategoryPackageManagement CategoryPackageManagement] [https://wiki.debian.org/CategorySystemAdministration CategorySystemAdministration]
===== Weblinks =====
# https://wiki.debian.org/CategoryPackageManagement
# https://wiki.debian.org/CategorySystemAdministration
# https://wiki.debian.org/UnattendedUpgrades
</noinclude>
[[Kategorie:APT]]

Aktuelle Version vom 19. Oktober 2024, 11:09 Uhr

Unattended Upgrades - Unbeaufsichtigte Upgrades

Beschreibung

Computer automatisch mit den neuesten Sicherheits- (und anderen) Updates auf dem neuesten Stand zu halten

  • Wenn Sie es verwenden möchten, sollten Sie über Möglichkeiten zur Überwachung Ihrer Systeme verfügen, z. B. durch die Installation des Pakets apt-listchanges und dessen Konfiguration
  • sodass Sie E-Mails über Aktualisierungen erhalten

Ändern von Download- und Upgrade-Zeitplänen (auf systemd)

Da Debian systemd verwendet, werden systemd timers verwendet, um regelmäßige APT-Wartungsaufgaben auszuführen.

Diese Dateien werden vom apt-Paket bereitgestellt

Die relevanten Dateien sind

  • Für „Downloads“ verwendet: /lib/systemd/system/apt-daily.timer
    • wird überschrieben durch /etc/systemd/system/apt-daily.timer.d/override.conf
  • Für „Upgrades“ verwendet: /lib/systemd/system/apt-daily-upgrade.timer
    • wird überschrieben durch /etc/systemd/system/apt-daily-upgrade.timer.d/override.conf

Die offiziellen Schritte zum Erstellen und Bearbeiten dieser Überschreibungen für diese Einstellungen sind für „Downloads“

sudo systemctl edit apt-daily.timer
sudo systemctl restart apt-daily.timer
sudo systemctl status apt-daily.timer 

3. optional, you can check the next trigger time with this)

or for upgrades

sudo systemctl edit apt-daily-upgrade.timer
sudo systemctl restart apt-daily-upgrade.timer
sudo systemctl status apt-daily-upgrade.timer (optional, you can check the next trigger time with this)

Hier ist ein Beispiel dafür, wie Sie die „Downloadzeit“ auf 1 Uhr morgens setzen können, indem Sie Folgendes über sudo systemctl edit apt-daily.timer hinzufügen

[Timer]
OnCalendar==
OnCalendar=01:00
RandomizedDelaySec=0

Zeile 2 oben wird benötigt, um den unten in Zeile 5 angezeigten Standardwert zurückzusetzen (zu leeren). Zeile 4 oben wird benötigt, um zufällige Verzögerungen durch die Standardwerte zu verhindern

Die aktuellen Standardwerte für Downloads sind /lib/systemd/system/apt-daily.timer (zum Zeitpunkt des Schreibens dieses Artikels)

[Unit]
Description=Daily apt download activities

[Timer]
OnCalendar=*-*-* 6,18:00
RandomizedDelaySec=12h
Persistent=true

[Install]
WantedBy=timers.target

Installation

Ab Debian 9 (Stretch) sind sowohl die Pakete unattended-upgrades als auch apt-listchanges standardmäßig installiert und Upgrades sind mit dem GNOME-Desktop

Um diese Pakete zu installieren, führen Sie den folgenden Befehl als root aus

apt-get install unattended-upgrades apt-listchanges

Syntax

Optionen

Parameter

Umgebungsvariablen

Exit-Status

Anwendung

Manueller Start (zur Fehlerbehebung)

Um die Fehlerbehebung zu unterstützen, müssen Sie möglicherweise unbeaufsichtigte Upgrades manuell ausführen.

sudo unattended-upgrade -d

Problembehebung

Konfiguration

Dateien

Die Standardkonfigurationsdatei für das Paket „unattended-upgrades“ befindet sich unter /etc/apt/apt.conf.d/50unattended-upgrades

  • Alle lokalen Anpassungen sollten sich unter /etc/apt/apt.conf.d/52unattended-upgrades-local befinden (weitere Informationen finden Sie in der README-Datei des Pakets)
editor /etc/apt/apt.conf.d/52unattended-upgrades-local

In diesem Abschnitt wird gesteuert, welche Pakete aktualisiert werden

Unattended-Upgrade::Origins-Pattern {
   // ..
};

Sie sollten zumindest die folgende Zeile auskommentieren

Unattended-Upgrade::Mail "root";

Automatischer Aufruf über /etc/apt/apt.conf.d/20auto-upgrades

Um unbeaufsichtigte Upgrades zu aktivieren, müssen Sie sicherstellen, dass die apt-Konfigurationsdatei /etc/apt/apt.conf.d/20auto-upgrades mindestens die folgenden Zeilen enthält

editor /etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

Die Datei /etc/apt/apt.conf.d/20auto-upgrades kann manuell erstellt werden oder indem der folgende Befehl als root ausgeführt wird

dpkg-reconfigure unattended-upgrades

Oder nicht interaktiv durch Ausführen

echo unattended-upgrades unattended-upgrades/enable_auto_updates boolean true | debconf-set-selections
dpkg-reconfigure -f noninteractive unattended-upgrades

Automatischer Aufruf über /etc/apt/apt.conf.d/02periodic

„Alternativ“ können Sie auch die apt-Konfigurationsdatei /etc/apt/apt.conf.d/02periodic erstellen, um unattended-upgrades zu aktivieren.

editor /etc/apt/apt.conf.d/02periodic

Unten sehen Sie ein Beispiel /etc/apt/apt.conf.d/02periodic

// Control parameters for cron jobs by /etc/cron.daily/apt-compat 
//
// Enable the update/upgrade script (0=disable)
APT::Periodic::Enable "1";

// Do "apt-get update" automatically every n-days (0=disable)
APT::Periodic::Update-Package-Lists "1";

// Do "apt-get upgrade --download-only" every n-days (0=disable)
APT::Periodic::Download-Upgradeable-Packages "1";

// Run the "unattended-upgrade" security upgrade script
// every n-days (0=disabled)
// Requires the package "unattended-upgrades" and will write
// a log in /var/log/unattended-upgrades
APT::Periodic::Unattended-Upgrade "1";

// Do "apt-get autoclean" every n-days (0=disable)
APT::Periodic::AutocleanInterval "21";

// Send report mail to root
//     0:  no report             (or null string)
//     1:  progress report       (actually any string)
//     2:  + command outputs     (remove -qq, remove 2>/dev/null, add -d)
//     3:  + trace on
APT::Periodic::Verbose "2";


Anhang

Siehe auch

Dokumentation

  • /usr/share/doc/unattended-upgrades/README.md.gz
  • /usr/share/doc/apt/examples/configure-index
  • /etc/cron.daily/apt
Man-Pages
Info-Pages

Links

Projekt

needrestart-Pakete, um zusätzliche laufende Prozesse zu identifizieren, die neu gestartet werden müssen, um (zuvor installierte Sicherheits-)Updates ohne Neustart anzuwenden

Weblinks
  1. https://wiki.debian.org/CategoryPackageManagement
  2. https://wiki.debian.org/CategorySystemAdministration
  3. https://wiki.debian.org/UnattendedUpgrades