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)
uname -r
I guess it will return4.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. Runningsudo 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.