Univention Bugzilla – Bug 31012
remove old kernel images before apt-get upgrade/dist-upgrade/install (apt-get hook?)
Last modified: 2013-04-24 17:26:27 CEST
After the update of an ucc client (to ucc-errata an with the ubuntu updates), the boot partition is pretty full. -> df -h /boot Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf /dev/vda2 92M 71M 17M 82% /boot The next update (with a new kernel) will definitely fail unless we somehow remove the old kernel. possible approach: We remove old, unused kernel packages before apt-get upgrade/dist-upgrade/install. Maybe there is a kind of apt-get hook for this.
> - Wir haben beim Kernel das Problem, dass die Bootpartition insgesamt sehr > klein ist. Derzeit passen zwei Kernel auf die Partition, ein dritter wird > schwierig. > > - Es gibt unterschiedliche Optionen, ich halte es für am sinnvollsten ein > Skript zu erstellen, mit dem alte Kernel deinstalliert werden können. > Zunächst einfach als Kommandozeilen Tool. > > - Auf einem Thin Client ist aktuell die Bootpartition zwar RO, aber wir > müssen das Paket aus dpkg entfernen. Da sehe ich nur die Option, dass wir > das in einem Pre-APT-Hook implementieren, gesteuert über eine UCR Variable. > Falls die Variable gesetzt ist, werden alle Kernel Varianten deinstalliert, > die entweder nicht laufen oder die am aktuellsten sind. Per Default sollten > wir die Variable setzen und direkt im Handbuch dokumentieren.
Created attachment 5168 [details] apt-get-pre-invoke-prune-kernel Added patch for univention-corporate-client New script in /usr/share/univention-corporate-client/apt-pre-invoke.d/univention-ucc-prune-old-kernel-packages used for deleting old kernel packages New apt-get pre-invoke config /etc/apt/apt.conf.d/900-ucc-pre-invoke starting run-parts /usr/share/univention-corporate-client/apt-pre-invoke.d [ucc/update/remove/old/kernel] Description[en]=Remove old kernel packages before managing software packages with apt-get (default: true) [ucc/update/remove/old/kernel/pkgregex] Description[en]=Regular expression used for search for kernel packages (default: linux-image-[[:digit:]])
Added apt-get Pre-Invoke Hook "run-parts /usr/share/univention-corporate-client/apt-get-pre-invoke.d" to run /usr/share/univention-corporate-client/apt-get-pre-invoke.d/univention-ucc-prune-old-kernel-packages (removes old, unused kernel packages). Configuration: [ucc/update/remove/old/kernel] Description[en]=Remove old kernel packages before managing software packages with apt-get (default: true) [ucc/update/remove/old/kernel/pkgregex] Description[en]=Regular expression used for search for kernel packages (default: linux-image-[[:digit:]]) YAML: 2013-04-23-univention-corporate-client.yaml QA: Has to be tested very carefully, because an error in univention-ucc-prune-old-kernel-packages stops the entire apt-get process.
Removal of unused kernel packages works: OK YAML: OK I could not produce a state in which the apt hook caused problems while installing/upgrading/removing packages. verified
http://errata.univention.de/ucc/1.0/12.html