Univention Bugzilla – Bug 32166
Improve script for removal of old kernels
Last modified: 2014-06-12 09:20:07 CEST
There are some problems with the script "/usr/share/univention-corporate-client/apt-get-pre-invoke.d/univention-ucc-prune-old-kernel-packages" . When the script is running to identified dpkg -p dependancy it is not recognize problems with old Kernels. The result is the old Kernals are marked as pi and persist on /boot.
The problem is reappeared. Processing triggers for initramfs-tools ... update-initramfs: Generating /boot/initrd.img-3.5.0-27-generic cryptsetup: WARNING: failed to detect canonical device of /dev/loop0 cryptsetup: WARNING: could not determine root device from /etc/fstab cryptsetup: WARNING: invalid line in /etc/crypttab for crypt - mv: writing `/boot/initrd.img-3.5.0-27-generic': No space left on device mv: failed to extend `/boot/initrd.img-3.5.0-27-generic': No space left on device dpkg: error processing initramfs-tools (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: linux-image-3.2.0-52-generic-pae linux-image-generic-pae initramfs-tools 2013090321001495
The following "miracle of predicate logic" helps on UCS systems; it was successfully used in hundreds of ucs-tests runs in the Amazone clould. Maybe a similar approach can help with UCC too: cmd = """aptitude remove ' ?installed ?name(linux-image-*) !?name(linux-image-'$(uname -r)') !?reverse-Depends( ?name(univention-kernel-image-*) ?version(TARGET) )'""".replace('\n', ' ') rv = ssh_exec(cmd) Translation to readable English: Remove all Linux Kernel images, which are neither the current running kernel nor the new default kernel selected by the univention-kernel-image packet.
The removal of old kernels generally works. One case where it could go wrong is if someone updates to a more recent kernel meta package. If the old meta package isn't removed, there's still a dependency on the most recent linux-image-3.2.0-52, so it cannot be removed. We don't provide official documentation on how to update to a more kernel, but I've added a comment to https://forge.univention.org/bugzilla/show_bug.cgi?id=31783#c5 When updating to UCC 1.1 this will be handled automatically, so no need for an erratum. One aspect of the script which should be improved in the removal script is that it currently only tests for the dpkg status "install ok installed". It should also cover "purge ok installed".
(In reply to Moritz Muehlenhoff from comment #3) > One aspect of the script which should be improved in the removal script is > that it currently only tests for the dpkg status "install ok installed". It > should also cover "purge ok installed". This should be fixed for 1.1.
fixed in univention-corporate-client/apt-get-pre-invoke.d/univention-ucc-prune-old-kernel-packages(In reply to Moritz Muehlenhoff from comment #4) > (In reply to Moritz Muehlenhoff from comment #3) > > One aspect of the script which should be improved in the removal script is > > that it currently only tests for the dpkg status "install ok installed". It > > should also cover "purge ok installed". > > This should be fixed for 1.1. fixed
(In reply to Felix Botner from comment #5) > fixed in > univention-corporate-client/apt-get-pre-invoke.d/univention-ucc-prune-old- > kernel-packages(In reply to Moritz Muehlenhoff from comment #4) > > (In reply to Moritz Muehlenhoff from comment #3) > > > One aspect of the script which should be improved in the removal script is > > > that it currently only tests for the dpkg status "install ok installed". It > > > should also cover "purge ok installed". > > > > This should be fixed for 1.1. > > fixed -> Verified successful removal of "purge ok installed" marked packages
*** Bug 31952 has been marked as a duplicate of this bug. ***
UCC 2.0 has been released: http://docs.univention.de/release-notes-ucc-2.0.html If this error occurs again, please use "Clone This Bug".