Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Whenever I try to apt-get install something or use the Synaptic Package Manager to install / uninstall something, I have to wait for > 10 minutes and the following report is generated:

(Reading database ... 146959 files and directories currently installed.)
Removing multitail ...
Processing triggers for man-db ...

Setting up linux-image-2.6.32-41-generic (2.6.32-41.94) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.32-41-generic
Running postinst hook script /usr/sbin/update-grub.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-45-generic
Found initrd image: /boot/initrd.img-2.6.32-45-generic
Found linux image: /boot/vmlinuz-2.6.32-43-generic
Found initrd image: /boot/initrd.img-2.6.32-43-generic
Found linux image: /boot/vmlinuz-2.6.32-42-generic
Found initrd image: /boot/initrd.img-2.6.32-42-generic
Found linux image: /boot/vmlinuz-2.6.32-41-generic
Found initrd image: /boot/initrd.img-2.6.32-41-generic
Found linux image: /boot/vmlinuz-2.6.32-21-generic
Found initrd image: /boot/initrd.img-2.6.32-21-generic
Found memtest86+ image: /boot/memtest86+.bin
done
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms 2.6.32-41-generic /boot/vmlinuz-2.6.32-41-generic
run-parts: failed to exec /etc/kernel/postinst.d/dkms: Exec format error
run-parts: /etc/kernel/postinst.d/dkms exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.32-41-generic.postinst line 1003.
dpkg: error processing linux-image-2.6.32-41-generic (--configure):
 subprocess installed post-installation script returned error exit status 2

Setting up linux-image-2.6.32-42-generic (2.6.32-42.96) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.32-42-generic
Running postinst hook script /usr/sbin/update-grub.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-45-generic
Found initrd image: /boot/initrd.img-2.6.32-45-generic
Found linux image: /boot/vmlinuz-2.6.32-43-generic
Found initrd image: /boot/initrd.img-2.6.32-43-generic
Found linux image: /boot/vmlinuz-2.6.32-42-generic
Found initrd image: /boot/initrd.img-2.6.32-42-generic
Found linux image: /boot/vmlinuz-2.6.32-41-generic
Found initrd image: /boot/initrd.img-2.6.32-41-generic
Found linux image: /boot/vmlinuz-2.6.32-21-generic
Found initrd image: /boot/initrd.img-2.6.32-21-generic
Found memtest86+ image: /boot/memtest86+.bin
done
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms 2.6.32-42-generic /boot/vmlinuz-2.6.32-42-generic
run-parts: failed to exec /etc/kernel/postinst.d/dkms: Exec format error
run-parts: /etc/kernel/postinst.d/dkms exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.32-42-generic.postinst line 1003.
dpkg: error processing linux-image-2.6.32-42-generic (--configure):
 subprocess installed post-installation script returned error exit status 2

Setting up linux-image-2.6.32-43-generic (2.6.32-43.97) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.32-43-generic
Running postinst hook script /usr/sbin/update-grub.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-45-generic
Found initrd image: /boot/initrd.img-2.6.32-45-generic
Found linux image: /boot/vmlinuz-2.6.32-43-generic
Found initrd image: /boot/initrd.img-2.6.32-43-generic
Found linux image: /boot/vmlinuz-2.6.32-42-generic
Found initrd image: /boot/initrd.img-2.6.32-42-generic
Found linux image: /boot/vmlinuz-2.6.32-41-generic
Found initrd image: /boot/initrd.img-2.6.32-41-generic
Found linux image: /boot/vmlinuz-2.6.32-21-generic
Found initrd image: /boot/initrd.img-2.6.32-21-generic
Found memtest86+ image: /boot/memtest86+.bin
done
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms 2.6.32-43-generic /boot/vmlinuz-2.6.32-43-generic
run-parts: failed to exec /etc/kernel/postinst.d/dkms: Exec format error
run-parts: /etc/kernel/postinst.d/dkms exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.32-43-generic.postinst line 1003.
dpkg: error processing linux-image-2.6.32-43-generic (--configure):
 subprocess installed post-installation script returned error exit status 2

Setting up linux-image-2.6.32-45-generic (2.6.32-45.102) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.32-45-generic

Running postinst hook script /usr/sbin/update-grub.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-45-generic
Found initrd image: /boot/initrd.img-2.6.32-45-generic
Found linux image: /boot/vmlinuz-2.6.32-43-generic
Found initrd image: /boot/initrd.img-2.6.32-43-generic
Found linux image: /boot/vmlinuz-2.6.32-42-generic
Found initrd image: /boot/initrd.img-2.6.32-42-generic
Found linux image: /boot/vmlinuz-2.6.32-41-generic
Found initrd image: /boot/initrd.img-2.6.32-41-generic
Found linux image: /boot/vmlinuz-2.6.32-21-generic
Found initrd image: /boot/initrd.img-2.6.32-21-generic
Found memtest86+ image: /boot/memtest86+.bin
done
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms 2.6.32-45-generic /boot/vmlinuz-2.6.32-45-generic
run-parts: failed to exec /etc/kernel/postinst.d/dkms: Exec format error
run-parts: /etc/kernel/postinst.d/dkms exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.32-45-generic.postinst line 1003.
dpkg: error processing linux-image-2.6.32-45-generic (--configure):
 subprocess installed post-installation script returned error exit status 2

dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-2.6.32-45-generic; however:
  Package linux-image-2.6.32-45-generic is not configured yet.
dpkg: error processing linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (= 2.6.32.45.52); however:
  Package linux-image-generic is not configured yet.
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
Setting up linux-headers-2.6.32-45-generic (2.6.32-45.102) ...

No apport report written because MaxReports has already been reached
No apport report written because MaxReports has already been reached
No apport report written because MaxReports has already been reached

Examining /etc/kernel/header_postinst.d.

run-parts: executing /etc/kernel/header_postinst.d/dkms 2.6.32-45-generic /boot/vmlinuz-2.6.32-45-generic
run-parts: failed to exec /etc/kernel/header_postinst.d/dkms: Exec format error
run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 1

Failed to process /etc/kernel/header_postinst.d at /var/lib/dpkg/info/linux-headers-2.6.32-45-generic.postinst line 110.

dpkg: error processing linux-headers-2.6.32-45-generic (--configure):
 subprocess installed post-installation script returned error exit status 2

dpkg: dependency problems prevent configuration of linux-headers-generic:
 linux-headers-generic depends on linux-headers-2.6.32-45-generic; however:
  Package linux-headers-2.6.32-45-generic is not configured yet.

dpkg: error processing linux-headers-generic (--configure):
 dependency problems - leaving unconfigured

No apport report written because MaxReports has already been reached
No apport report written because MaxReports has already been reached

Errors were encountered while processing:
 linux-image-2.6.32-41-generic
 linux-image-2.6.32-42-generic
 linux-image-2.6.32-43-generic
 linux-image-2.6.32-45-generic
 linux-image-generic
 linux-generic
 linux-headers-2.6.32-45-generic
 linux-headers-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

There's a great delay whenever this line is shown:

update-initramfs: Generating /boot/initrd.img-2.6.32-XXX-generic

...where XXX in my case takes values from 41 to 45.

My uname -srv reports:

Linux 2.6.32-45-generic #102-Ubuntu SMP Wed Jan 2 21:53:06 UTC 2013

I've tried sudo apt-get install -f but it did not solve my issue.

I don't know if it helps but the final dialog box that Synaptic package manager shows whenever a package is removed or added is:

E: linux-image-2.6.32-41-generic: subprocess installed post-installation script     returned error exit status 2
E: linux-image-2.6.32-42-generic: subprocess installed post-installation script     returned error exit status 2
E: linux-image-2.6.32-43-generic: subprocess installed post-installation script returned error exit status 2
E: linux-image-2.6.32-45-generic: subprocess installed post-installation script returned error exit status 2
E: linux-image-generic: dependency problems - leaving unconfigured
E: linux-generic: dependency problems - leaving unconfigured
E: linux-headers-2.6.32-45-generic: subprocess installed post-installation script     returned error exit status 2
E: linux-headers-generic: dependency problems - leaving unconfigured

Oh, and I'm on Ubuntu 10.04LTS.

@Wolfer: The command outputs the following:

> dpkg -l | grep linux-header
ii  linux-headers-2.6.32-45              2.6.32-45.102                                       Header files related to Linux kernel version
iF  linux-headers-2.6.32-45-generic      2.6.32-45.102                                   Linux kernel headers for version 2.6.32 on x
iU  linux-headers-generic                2.6.32.45.52                                    Generic Linux kernel headers

I'm not a power user (yet? :)) This VM was given to me from work and I was simply trying to "tidy up" / personalise. No idea when this was created (year ago? Maybe more?).

dpkg -l | grep linux-image reports the following:

> dpkg -l | grep linux-image
pi  linux-image-2.6.32-21-generic        2.6.32-21.32       Linux kernel image for version 2.6.32 on x86
iF  linux-image-2.6.32-41-generic        2.6.32-41.94       Linux kernel image for version 2.6.32 on x86
iF  linux-image-2.6.32-42-generic        2.6.32-42.96       Linux kernel image for version 2.6.32 on x86
iF  linux-image-2.6.32-43-generic        2.6.32-43.97       Linux kernel image for version 2.6.32 on x86
iF  linux-image-2.6.32-45-generic        2.6.32-45.102      Linux kernel image for version 2.6.32 on x86
iU  linux-image-generic                  2.6.32.45.52       Generic Linux kernel image

@Wolfer: apt-get install linux-generic gives me:

[sudo] password for ubuntu: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 18 not upgraded.
8 not fully installed or removed.
After this operation, 0B of additional disk space will be used.

...and then the same thing all over again, it starts with:

Setting up linux-image-2.6.32-41-generic (2.6.32-41.94) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.32-41-generic
... and on and on ...
share|improve this question
    
Why are you still using an old kernel? –  Wolfer Jan 28 '13 at 18:36
    
Also what does dpkg -l | grep linux-header output? –  Wolfer Jan 28 '13 at 18:37
1  
@Wolfer: I've just edited my question to show the output of the dpkg command (aparently we cannot do code blocks in comments?) –  Angelos Jan 29 '13 at 7:52
    
Hmmm... the fact that update-initramfs takes a long time and uses a lot of different kernels is because you seem to have more than one kernel currently installed. While this is not an error in and of itself its generally useless as you will end up only using one anyways. You can find out which ones you have by running dpkg -l | grep linux-image. –  Wolfer Jan 29 '13 at 17:00
1  
Hey @Wolfer, thanks for the comment. Check out the bottom part of the question (above) I've updated it to include the output you requested :) –  Angelos Jan 29 '13 at 17:06
show 1 more comment

1 Answer 1

up vote 1 down vote accepted

The linux-image-generic is not set up properly on your system. This means that apt won't be able to install/update/configure any other kernels as well. This results in the error you are getting. There are a few ways to deal with this; the easiest would be to run apt-get install linux-image-generic, and see what happens. If this works (I think it should) then follow that up by running apt-get install -f.

If you get any more errors in the process post them here.


Okay, it seems that the easiest path won't work. Try running dpkg --unpack linux-image-generic. If you get an error about that there's no such package (which is likely) run

wget http://ubuntu.secsup.org//pool/main/l/linux-meta/linux-image-generic_2.6.32.45.52_i386.deb and then dpkg -i <path to the package you downloaded>. If there's any error post it here.


You ran into a dependency-chain problem. You can resolve this by manually downloading and trying to install every package that is mentioned in the errors you get. Eventually you should find the root of the problem and that should cause every other package to be corrected as well.

share|improve this answer
1  
No joy I'm afraid :( I've updated the main question body (at the end) so I could properly paste the code blocks. –  Angelos Jan 30 '13 at 11:35
    
Updated my answer as well. –  Wolfer Jan 30 '13 at 18:19
1  
As you mentioned. The first command fails (no such package) and for the second, I had to find a list of mirrors from that package from packages.ubuntu.com/lucid-updates/i386/linux-image-generic/… but after I downloaded when I tried to run I got: Unpacking replacement linux-image-generic ... dpkg: dependency problems prevent configuration of linux-image-generic: linux-image-generic depends on linux-image-2.6.32-45-generic; however: Package linux-image-2.6.32-45-generic is not configured yet. –  Angelos Jan 31 '13 at 18:12
    
Updated my answer. Also sorry for not being able to answer sooner. –  Wolfer Feb 3 '13 at 14:47
    
Thanks for the effort Wolfer! –  Angelos Feb 3 '13 at 20:28
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.