Public bug reported:

Binary package hint: linux-restricted-modules-2.6.26-5-generic

Investigating a different bug, I installed the latest intrepid kernel
packages on a hardy system. After that, I tried to remove a previous
intrepid kernel version. I'll attach a verbose log of the commands I
used and the output they generated. The core of the problem is this
error message:

Removing linux-restricted-modules-2.6.26-5-generic ...
FATAL: Could not open '/boot/System.map-2.6.26-5-generic': No such file or 
directory
update-initramfs: Generating /boot/initrd.img-2.6.26-5-generic
Cannot find /lib/modules/2.6.26-5-generic
update-initramfs: failed for /boot/initrd.img-2.6.26-5-generic
dpkg: error processing linux-restricted-modules-2.6.26-5-generic (--remove):
 subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-restricted-modules-2.6.26-5-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

The script /var/lib/dpkg/info/linux-restricted-
modules-2.6.26-5-generic.postrm seems to return an error code of 1
because it calls both depmod and update-initramfs unconditionally, and
returns the exit code of the last command called as its own exit code.
depmod and update-initramfs fail because the kernel package has already
been uninstalled at that time.

A quick and dirty fix is to append the command "true" to the list of
commands executet during removal. This will cause the script never to
fail, regardless of previous errors. If on the other hand you want to
provide more elaborate error handling, then the exit status of depmod
should be checked as well, and both should be skipped if the
corresponding kernel package is no longer available.

** Affects: linux-restricted-modules (Ubuntu)
     Importance: Undecided
         Status: New

-- 
linux-restricted-modules postrm script dies for removed kernel
https://bugs.launchpad.net/bugs/263596
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to