-1

I had an error occur when updating using the standard ubuntu updater. Afterwards, after a bug report was sent, i typed this into the console.

Is there any way back from this or is it a re-install?

~ sudo apt-get -f install
[sudo] password for gary: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  linux-image-extra-4.4.0-21-generic
0 to upgrade, 0 to newly install, 1 to remove and 0 not to upgrade.
8 not fully installed or removed.
After this operation, 162 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 222138 files and directories currently installed.)
Removing linux-image-extra-4.4.0-21-generic (4.4.0-21.37) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-21-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-21-generic /boot/vmlinuz-4.4.0-21-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-21-generic /boot/vmlinuz-4.4.0-21-generic
Error! Your kernel headers for kernel 4.4.0-21-generic cannot be found.
Please install the linux-headers-4.4.0-21-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-21-generic cannot be found.
Please install the linux-headers-4.4.0-21-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-21-generic /boot/vmlinuz-4.4.0-21-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-21-generic
WARNING: missing /lib/modules/4.4.0-21-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-21-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
cp: cannot stat '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf': No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-21-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-21-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.4.0-21-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
2
  • 1
    those messages all relate to the oldest kernel, so not scary (check uname -r I guess it will return 4.4.0-24-generic, the new kernel) Apparently this old kernel has already been (partly?) deleted (which is good) and --fix-missing is trying to remove it again. Running sudo apt autoremove or just a reboot may calm things down. If not, you might have to remove some files relating to the old kernel by hand, which is easy to do.
    – Zanna
    Jun 10, 2016 at 16:18
  • did you manage to fix this issue?
    – Zanna
    Nov 24, 2016 at 14:52

2 Answers 2

1

Before running apt-get install -f see if the postinst script of the kernel package completes its setup. To do this type:

sudo /var/lib/dpkg/info/linux-image-extra-4.4.0-21-generic.postinst configure

This should complete the postinst process before trying to remove the package, I think.

0

I see you use /etc/default/grub: i915.preliminary_hw_support=1:

this is fix for some bugs (suggested by AskUbuntu users) but it also messes up upgrade process. Just delete that line from grub file, restart and you should be good to go.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .