Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
   I have not been able to install new packages in Ubuntu since the linux-restricted-modules-2.6.28-17-generic package is broken...

   I get the following errors while installing any package....I had once been stupid enough to delete the /lib/modules/2.6.28-17 directory while removing the 2.6.28-17 kernel files, Instead of uninstalling it. Is there any way to rectify (work around) this problem...How would it be if I simply try to recreate the file structure in /var/lib/dpkg/info/linux-restricted-modules-2.6.28-17-generic.postrm, Just a suggestion, would it work???  Please help me out!!!

   Removing linux-restricted-modules-2.6.28-17-generic ...

rmdir: failed to remove `/lib/modules/2.6.28-17-generic/volatile/': No such file or directory FATAL: Could not open '/boot/System.map-2.6.28-17-generic': No such file or directory update-initramfs: Generating /boot/initrd.img-2.6.28-17-generic Cannot find /lib/modules/2.6.28-17-generic update-initramfs: failed for /boot/initrd.img-2.6.28-17-generic dpkg: error processing linux-restricted-modules-2.6.28-17-generic (--remove): subprocess installed post-removal script returned error exit status 1 Errors were encountered while processing: linux-restricted-modules-2.6.28-17-generic

E: Sub-process /usr/bin/dpkg returned an error code (1)

Thanks a lot, Avinash.

share|improve this question
    
Does this help? apt-get -f install –  Janne Pikkarainen Jul 31 '10 at 16:08
    
No it does not...tried it yesterday & i got the same error –  Avinash Aug 1 '10 at 2:49
add comment

1 Answer

up vote 1 down vote accepted

When a package's prerm or postrm script fails, often your best bet is to edit the script in /var/lib/dpkg/info and comment out (or sometimes tweak) the failing lines. You should review carefully what those lines are doing and try to manually do what they attempted to do.

In your case, you've already deleted the files that the script is trying to delete, so comment out the failing lines in /var/lib/dpkg/info/linux-restricted-modules-2.6.28-17-generic.postrm and run dpkg --remove linux-restricted-modules-2.6.28-17-generic.

Once you've removed the offending package, run apt-get -f install to finish any package management operation (install, configure, remove, …) that was waiting on the removal.

share|improve this answer
    
Hey thanks a lot, for the reply. I'll just try that... –  Avinash Aug 1 '10 at 2:51
    
It worked like a charm...Thanks again... –  Avinash Aug 1 '10 at 3:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.