<SOLVED>Broken kernel packages

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
dookov
Level 1
Level 1
Posts: 23
Joined: Mon Jun 11, 2012 3:54 pm

<SOLVED>Broken kernel packages

Post by dookov »

Hi, I hope someone can supply an easy solution to my problem.
I`ve been using Sonya 64bit Mate edition with Kernel 4.10.0.35 since the release with no problems whatsoever. The update manager has been showing an update to kernel 4.10.0.38 for weeks now, and I finally decided (stupidly) to try it. It said it was installed in the update manager so I updated Grub and rebooted but it booted to 4.10.0.35, so I uninstalled 4.10.0.38. Update manager says it is uninstalled. Now when I use package manager or software manager or even terminal to install anything I get this message `E: linux-image-extra-4.10.0-38-generic: subprocess installed post-removal script returned error exit status 1` also `linux-image-extra-4.10.0-38-generic has broken dependencies` When I try to fix the broken dependencies, it can`t find 4.10.0.38.
If you need more info, please point me in the right direction.
Hope this makes sense to someone.
Thanks

EDIT: these are the details from package manager error

Code: Select all

Error! echo
Your kernel headers for kernel 4.10.0-38-generic cannot be found at
/lib/modules/4.10.0-38-generic/build or /lib/modules/4.10.0-38-generic/source.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-38-generic /boot/vmlinuz-4.10.0-38-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-38-generic
WARNING: missing /lib/modules/4.10.0-38-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.10.0-38-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
Warning: No support for locale: en_GB.utf8
cp: cannot stat '/etc/udev/udev.conf': No such file or directory
E: /usr/share/initramfs-tools/hooks/udev failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.10.0-38-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.10.0-38-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.10.0-38-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
WharfRat

Re: Broken kernel packages

Post by WharfRat »

How did you uninstalled 4.10.0.38 :?:

Paste back dpkg -l|grep 4.10.0-38
dookov
Level 1
Level 1
Posts: 23
Joined: Mon Jun 11, 2012 3:54 pm

Re: Broken kernel packages

Post by dookov »

Thanks for your time,
uninstalled through update manager, view. linux kernel.

Code: Select all

~ $ dpkg -l|grep 4.10.0-38
pc  linux-image-4.10.0-38-generic               4.10.0-38.42~16.04.1                         amd64        Linux kernel image for version 4.10.0 on 64 bit x86 SMP
rH  linux-image-extra-4.10.0-38-generic         4.10.0-38.42~16.04.1                         amd64        Linux kernel extra modules for version 4.10.0 on 64 bit x86 SMP
Last edited by Anonymous on Sat Nov 18, 2017 3:22 pm, edited 1 time in total.
Reason: Added code tag
WharfRat

Re: Broken kernel packages

Post by WharfRat »

Try to purge those packages with sudo apt-get purge linux-image-4.10.0-38-generic linux-image-extra-4.10.0-38-generic
dookov
Level 1
Level 1
Posts: 23
Joined: Mon Jun 11, 2012 3:54 pm

Re: Broken kernel packages

Post by dookov »

I did try that, I tried again and got this..

Code: Select all

$ sudo apt-get purge linux-image-4.10.0-38-generic linux-image-extra-4.10.0-38-generic
[sudo] password for alan: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  linux-image-4.10.0-38-generic* linux-image-extra-4.10.0-38-generic
0 to upgrade, 0 to newly install, 2 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 156 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 338669 files and directories currently installed.)
Removing linux-image-extra-4.10.0-38-generic (4.10.0-38.42~16.04.1) ...
depmod: FATAL: could not load /boot/System.map-4.10.0-38-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-38-generic /boot/vmlinuz-4.10.0-38-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-38-generic /boot/vmlinuz-4.10.0-38-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-38-generic /boot/vmlinuz-4.10.0-38-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-38-generic
Warning: No support for locale: en_GB.utf8
cp: cannot stat '/etc/udev/udev.conf': No such file or directory
E: /usr/share/initramfs-tools/hooks/udev failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.10.0-38-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.10.0-38-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.10.0-38-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Last edited by Anonymous on Sat Nov 18, 2017 3:31 pm, edited 1 time in total.
Reason: Added code tag
WharfRat

Re: Broken kernel packages

Post by WharfRat »

Try sudo apt-get install --fix-broken
dookov
Level 1
Level 1
Posts: 23
Joined: Mon Jun 11, 2012 3:54 pm

Re: Broken kernel packages

Post by dookov »

Brings the same result..

Code: Select all

$ sudo apt-get install --fix-broken
[sudo] password for alan: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  linux-image-extra-4.10.0-38-generic
0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 156 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 338669 files and directories currently installed.)
Removing linux-image-extra-4.10.0-38-generic (4.10.0-38.42~16.04.1) ...
depmod: FATAL: could not load /boot/System.map-4.10.0-38-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-38-generic /boot/vmlinuz-4.10.0-38-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-38-generic /boot/vmlinuz-4.10.0-38-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-38-generic /boot/vmlinuz-4.10.0-38-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-38-generic
Warning: No support for locale: en_GB.utf8
cp: cannot stat '/etc/udev/udev.conf': No such file or directory
E: /usr/share/initramfs-tools/hooks/udev failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.10.0-38-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.10.0-38-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.10.0-38-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Last edited by Anonymous on Sat Nov 18, 2017 3:38 pm, edited 1 time in total.
Reason: Added code tag
minitux

Re: Broken kernel packages

Post by minitux »

Code: Select all

sudo rm /var/lib/dpkg/info/linux-image-extra-4.10.0-38-generic.postrm

Code: Select all

sudo apt-get install -f
?
WharfRat

Re: Broken kernel packages

Post by WharfRat »

I noticed that the errors reference a missing /etc/udev/udev.conf

Do you have that filels -lh /etc/udev/udev.conf :?:
dookov
Level 1
Level 1
Posts: 23
Joined: Mon Jun 11, 2012 3:54 pm

Re: Broken kernel packages

Post by dookov »

YES!!!
the solution from minitux worked.
Thank you both for your help.
Note to myself "Don`t mess with it if it`s working!"
minitux

Re: <SOLVED>Broken kernel packages

Post by minitux »

dookov wrote:YES!!!
the solution from minitux worked.
Thank you both for your help.
Nice.....bye :D
Locked

Return to “Beginner Questions”