2

So I feel like a dunce having to post about this but, I need help trying to fix this issue, mostly because without the fix I can't install any new software or run updates. For some reason one of the kernals must not have been fully uninstalled (linux-image-3.16.0-34-generic), so I tried to do the first thing that came to mind: apt-get -f install... That fails and gives this:

cictrone@cictrone:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-image-3.16.0-34-generic linux-image-extra-3.16.0-34-generic
0 upgraded, 0 newly installed, 2 to remove and 14 not upgraded.
7 not fully installed or removed.
After this operation, 201 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 241430 files and directories currently installed.)
Removing linux-image-extra-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
depmod: ERROR: could not open directory /lib/modules/3.16.0-34-generic:No such file or directory
depmod: FATAL: could not search modules: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
Error! echo
Your kernel headers for kernel 3.16.0-34-generic cannot be found at
/lib/modules/3.16.0-34-generic/build or /lib/modules/3.16.0-34-generic/source.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-34-generic
grep: /boot/config-3.16.0-34-generic: No such file or directory
WARNING: missing /lib/modules/3.16.0-34-generic
Device driver support needs thus be built-in linux image!
depmod: ERROR: could not open directory /lib/modules/3.16.0-34-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_raVmra/lib/modules/3.16.0-34-generic/modules.order: No such file or directory
depmod: WARNING: could not open /tmp/mkinitramfs_raVmra/lib/modules/3.16.0-34-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home    /cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-3.16.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
update-initramfs: Deleting /boot/initrd.img-3.16.0-34-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.16.0-34-generic.postrm line 328.
dpkg: error processing package linux-image-3.16.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-3.16.0-34-generic
 linux-image-3.16.0-34-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've also tried:

  1. sudo dpkg -C
  2. sudo apt-get autoremove
  3. sudo dpkg --remove
  4. sudo dpkg --configure -a
  5. sudo dpkg --remove --force-remove-reinstreq
  6. sudo apt-get autoclean

The output of my uname -r:

3.16.0-41-generic

The output of Terrance's suggestion:

cictrone@cictrone:~$ sudo apt-get install linux-image-3.16.0-34-generic linux-headers-3.16.0-34-generic linux-image-extra-3.16.0-34-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-3.16.0-34-generic is already the newest version.
linux-image-3.16.0-34-generic is already the newest version.    
linux-image-extra-3.16.0-34-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
7 not fully installed or removed.
Need to get 0 B/53.9 MB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
dpkg: error processing package linux-image-3.16.0-34-generic (--configure):
 package linux-image-3.16.0-34-generic is not ready for configuration
 cannot configure (current status `half-installed')
Setting up linux-image-3.16.0-43-generic (3.16.0-43.58~14.04.1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
initrd.img(/boot/initrd.img-3.16.0-43-generic) points to /boot/initrd.img-3.16.0-43-generic
 (/boot/initrd.img-3.16.0-43-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-3.16.0-43-generic.postinst line 491.
vmlinuz(/boot/vmlinuz-3.16.0-43-generic) points to /boot/vmlinuz-3.16.0-43-generic
 (/boot/vmlinuz-3.16.0-43-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-3.16.0-43-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.16.0-43-generic.postinst line 1025.
dpkg: error processing package linux-image-3.16.0-43-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up grub-pc (2.02~beta2-9ubuntu1.3+elementary10~ubuntu0.3.1) ...
/var/lib/dpkg/info/grub-pc.config: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
dpkg: error processing package grub-pc (--configure):
 subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of linux-image-extra-3.16.0-43-generic:
 linux-image-extra-3.16.0-43-generic depends on linux-image-3.16.0-43-generic; however:
  Package linux-image-3.16.0-43-generic is not configured yet.

dpkg: error processing package linux-image-extra-3.16.0-43-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic-lts-utopic:
 linux-image-generic-lts-utopic depends on linux-image-3.16.0-43-generic; however:
  Package linux-image-3.16.0-43-generic is not configured yet.
 linux-image-generic-lts-utopic depends on linux-image-extra-3.16.0-43-generic; however:
  Package linux-image-extra-3.16.0-43-generic is not configured yet.

dpkg: error processing package linux-image-generic-lts-utopic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic-lts-utopic:
 linux-generic-lts-utopic depends on linux-image-generic-No apport report written because MaxReports is reached already
 No apport report written because MaxReports is reached already
 No apport report written because MaxReports is reached already
 No apport report written because MaxReports is reached already
lts-utopic (= 3.16.0.43.34); however:
 Package linux-image-generic-lts-utopic is not configured yet.
dpkg: error processing package linux-generic-lts-utopic (--configure):
 dependency problems - leaving unconfigured
dpkg: error processing package linux-image-extra-3.16.0-34-generic (--configure):
 package linux-image-extra-3.16.0-34-generic is not ready for configuration
 cannot configure (current status `half-installed')
    Errors were encountered while processing:
     linux-image-3.16.0-34-generic
     linux-image-3.16.0-43-generic
     grub-pc
     linux-image-extra-3.16.0-43-generic
     linux-image-generic-lts-utopic
     linux-generic-lts-utopic
     linux-image-extra-3.16.0-34-generic
    E: Sub-process /usr/bin/dpkg returned an error code (1)

The following is the output from the remove command after issueing the reinstall command (apt-get):

cictrone@cictrone:~$ sudo apt-get remove linux-image-3.16.0-34-generic linux-headers-3.16.0-34-generic linux-image-extra-3.16.0-34-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-headers-3.16.0-34
Use 'apt-get autoremove' to remove it.
The following packages will be REMOVED:
  linux-headers-3.16.0-34-generic linux-image-3.16.0-34-generic
  linux-image-extra-3.16.0-34-generic
0 upgraded, 0 newly installed, 3 to remove and 15 not upgraded.
7 not fully installed or removed.
After this operation, 215 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 271286 files and directories currently installed.)
Removing linux-image-extra-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
update-initramfs: Generating /boot/initrd.img-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-3.16.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
Examining /etc/kernel/prerm.d.
run-parts: executing /etc/kernel/prerm.d/dkms 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
dkms: removing: bcmwl 6.30.223.248+bdcom (3.16.0-34-generic) (x86_64)

-------- Uninstall Beginning --------
Module:  bcmwl
Version: 6.30.223.248+bdcom
Kernel:  3.16.0-34-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

wl.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.16.0-34-generic/extra/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
update-initramfs: Deleting /boot/initrd.img-3.16.0-34-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-3.16.0-34-generic.postrm line 328.
dpkg: error processing package linux-image-3.16.0-34-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-headers-3.16.0-34-generic (3.16.0-34.47~14.04.1) ...
Errors were encountered while processing:
 linux-image-extra-3.16.0-34-generic
 linux-image-3.16.0-34-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

These ubuntu tweaks tool (was able to get it installed) also sees the kernel but gives same errors as the terminal.

Any help is appreciated, thanks.

****Solved****

It turned out that the kernel issue wasn't the cause of holding aptitude up. It was actually grub.The line in particular :

/usr/sbin/grub-mkconfig: 39: /etc/default/grub: desktop-image=/home/cictrone/Pictures/grub-splash.jpg: not found

I went it to the file and deleted the line with the problem and then ran Terrence's suggestions and everything is fixed! Thanks Everyone.

  • How about apt-get update before apt-get remove? – mgor Jul 24 '15 at 18:11
  • I cannot run apt-get update without rnning into the same issue that is show in the -f install output – Nicholas O'Brien Jul 24 '15 at 18:33
  • remove the image and then the headers in different steps. – Karl Richter Jul 24 '15 at 19:41
  • Tried doing them one by one and it didn't work, thanks for the attempt – Nicholas O'Brien Jul 25 '15 at 14:55
1

Try reinstalling that kernel then remove it.

Reinstall:

sudo apt-get install --reinstall linux-image-3.16.0-34-generic linux-headers-3.16.0-34-generic linux-image-extra-3.16.0-34-generic

Remove:

sudo apt-get remove linux-image-3.16.0-34-generic linux-headers-3.16.0-34-generic linux-image-extra-3.16.0-34-generic
  • Thanks for the suggestion! Unfortunately it did not work, i will post the output above. – Nicholas O'Brien Jul 24 '15 at 18:23
  • @NicholasO'Brien I edited one thing. Can you try it again with the --reinstall added to the reinstall line? I am hoping that we can get this all solved for you. =) – Terrance Jul 25 '15 at 2:07
  • Uggh No dice... I'll post the new output above thanks again – Nicholas O'Brien Jul 25 '15 at 14:23
  • @NicholasO'Brien very nice to see that you have it fixed! Hope you have a great weekend! =) – Terrance Jul 25 '15 at 22:02
0

Give Ubuntu-Tweak a try. It removes old kernels well for me.

  • Unfortunately I cannot install the dependencies for it because of this issue. Thanks for the help though – Nicholas O'Brien Jul 24 '15 at 18:45
0

What's the running-kernel?

You need to pay attention to this:

run-parts: executing /etc/kernel/prerm.d/dkms 3.16.0-34-generic /boot/vmlinuz-3.16.0-34-generic
dkms: removing: bcmwl 6.30.223.248+bdcom (3.16.0-34-generic) (x86_64)

-------- Uninstall Beginning --------
Module:  bcmwl
Version: 6.30.223.248+bdcom
Kernel:  3.16.0-34-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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