Unable to purge package

Bug #122421 reported by Mehdi Abaakouk
10
Affects Status Importance Assigned to Milestone
linux-ubuntu-modules-2.6.22 (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

#sudo aptitude purge linux-ubuntu-modules-2.6.22-6-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following packages will be REMOVED:
  linux-ubuntu-modules-2.6.22-6-generic{p}
0 packages upgraded, 0 newly installed, 1 to remove and 2 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Do you want to continue? [Y/n/?]
Writing extended state information... Done
(Reading database ... 213814 files and directories currently installed.)
Removing linux-ubuntu-modules-2.6.22-6-generic ...
Purging configuration files for linux-ubuntu-modules-2.6.22-6-generic ...
FATAL: Could not open '/boot/System.map-2.6.22-6-generic': No such file or directory
update-initramfs: Generating /boot/initrd.img-2.6.22-6-generic
Cannot find /lib/modules/2.6.22-6-generic
update-initramfs: failed for /boot/initrd.img-2.6.22-6-generic
dpkg: error processing linux-ubuntu-modules-2.6.22-6-generic (--purge):
 subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-ubuntu-modules-2.6.22-6-generic

I'am unable to purge the package due to an wrong .postrm script because I have uninstalled the linux-image-2.6.22-6-generic before purging the package linux-ubuntu-modules-2.6.22-6-generic.

I think postrm script needs to check if the correspondents linux-image-2.6.22-XXX are installed or not.

Proposed patch (or something like this):

--- debian/control-scripts/postrm.ori 2007-06-26 22:13:13.000000000 +0200
+++ debian/control-scripts/postrm 2007-06-26 22:15:40.000000000 +0200
@@ -2,7 +2,9 @@

 case "$1" in
   remove|purge)
- depmod -a -A -q -F /boot/System.map-@@KVER@@ @@KVER@@
- update-initramfs -u -k @@KVER@@
+ if [ -f /boot/initrd.img-@@KVER@@ ]; then
+ depmod -a -A -q -F /boot/System.map-@@KVER@@ @@KVER@@
+ update-initramfs -u -k @@KVER@@
+ fi
     ;;
 esac

Revision history for this message
Henrique Ferreiro (henrique-ferreiro) wrote :

I had the same behaviour for linux-ubuntu-modules-2.6.22-7-generic.

Changed in linux-ubuntu-modules-2.6.22:
status: New → Confirmed
Revision history for this message
reacocard (reacocard) wrote :

I can also replicate this behovior, the only way to purge ubuntu-modules is to reinstall the corresponding linux-image before removal. (or remove the postrm in /var/lib/dpkg but that's nasty).

Also, bug 138552 appears to be a duplicate of this: https://bugs.launchpad.net/ubuntu/+source/linux-ubuntu-modules-2.6.22/+bug/138552

Revision history for this message
Daniel Hahler (blueyed) wrote :

Thank you for reporting this bug.
I'm marking this as duplicate of bug 149836.

Changed in linux-ubuntu-modules-2.6.22:
importance: Undecided → Medium
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.