I was trying to upgrade to 16.10 and it crashes in the middle. Now I get an error whenever I try to update anything.
uname -r
outputs 4.4.0-53-generic
.
This is the error I get with any apt-get command I execute sudo apt-get upgrade -f
:
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 251316 files and directories currently installed.)
Removing linux-image-extra-4.4.0-51-generic (4.4.0-51.72) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-51-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic
Error! Your kernel headers for kernel 4.4.0-51-generic cannot be found.
Please install the linux-headers-4.4.0-51-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-51-generic /boot/vmlinuz-4.4.0-51-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-51-generic
/usr/sbin/mkinitramfs: 66: .: Can't open /etc/initramfs-tools/initramfs.conf
update-initramfs: failed for /boot/initrd.img-4.4.0-51-generic with 2.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 2
dpkg: error processing package linux-image-extra-4.4.0-51-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-4.4.0-51-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Being a not experienced Linux guy, what should I do to fix this error?