I tried to insall java but it give me these error. Anything i do it return me those error.
How can I solve it?
sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-image-extra-4.10.0-27-generic linux-image-extra-4.10.0-28-generic
linux-image-extra-4.8.0-36-generic linux-image-extra-4.8.0-58-generic
0 upgraded, 0 newly installed, 4 to remove and 6 not upgraded.
4 not fully installed or removed.
After this operation, 637 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 284783 files and directories currently installed.)
Removing linux-image-extra-4.10.0-27-generic (4.10.0-27.30~16.04.2) ...
depmod: FATAL: could not load /boot/System.map-4.10.0-27-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-27-generic /boot/vmlinuz-4.10.0-27-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-27-generic /boot/vmlinuz-4.10.0-27-generic
Error! Your kernel headers for kernel 4.10.0-27-generic cannot be found.
Please install the linux-headers-4.10.0-27-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-27-generic /boot/vmlinuz-4.10.0-27-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-27-generic
WARNING: missing /lib/modules/4.10.0-27-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.10.0-27-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
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-27-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-27-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.10.0-28-generic (4.10.0-28.32~16.04.2) ...
depmod: FATAL: could not load /boot/System.map-4.10.0-28-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
Error! Your kernel headers for kernel 4.10.0-28-generic cannot be found.
Please install the linux-headers-4.10.0-28-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-28-generic /boot/vmlinuz-4.10.0-28-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-28-generic
WARNING: missing /lib/modules/4.10.0-28-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.10.0-28-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
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-28-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-28-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.8.0-36-generic (4.8.0-36.36~16.04.1) ...
depmod: FATAL: could not load /boot/System.map-4.8.0-36-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-36-generic /boot/vmlinuz-4.8.0-36-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.8.0-36-generic /boot/vmlinuz-4.8.0-36-generic
Error! Your kernel headers for kernel 4.8.0-36-generic cannot be found.
Please install the linux-headers-4.8.0-36-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-36-generic /boot/vmlinuz-4.8.0-36-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-36-generic
WARNING: missing /lib/modules/4.8.0-36-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.8.0-36-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
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.8.0-36-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.8.0-36-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.8.0-58-generic (4.8.0-58.63~16.04.1) ...
depmod: FATAL: could not load /boot/System.map-4.8.0-58-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.8.0-58-generic /boot/vmlinuz-4.8.0-58-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.8.0-58-generic /boot/vmlinuz-4.8.0-58-generic
Error! Your kernel headers for kernel 4.8.0-58-generic cannot be found.
Please install the linux-headers-4.8.0-58-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.8.0-58-generic /boot/vmlinuz-4.8.0-58-generic
update-initramfs: Generating /boot/initrd.img-4.8.0-58-generic
WARNING: missing /lib/modules/4.8.0-58-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.8.0-58-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
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.8.0-58-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.8.0-58-generic (--remove):
subprocess installed post-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
linux-image-extra-4.10.0-27-generic
linux-image-extra-4.10.0-28-generic
linux-image-extra-4.8.0-36-generic
linux-image-extra-4.8.0-58-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt autoremove
? – Yaron Sep 17 '17 at 07:04sudo dpkg --configure -a
– George Udosen Sep 17 '17 at 07:06