sudo apt remove linux-headers-4.4.0-51 Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: aptitude-common g++-4.8 giblib1 heirloom-mailx icedtea-netx icedtea-netx-common libass4 libatk-wrapper-java libatk-wrapper-java-jni libavcodec54 libavformat54 libavutil52 libbasicusageenvironment0 libboost-iostreams1.54.0 libdee-qt5-3 libdirac-encoder0 libdvbpsi8 libept1.4.12 libgif4 libgroupsock1 liblivemedia23 libmagickcore5 libmagickwand5 libopenjpeg2 libpostproc52 libstdc++-4.8-dev libswscale2 libsystemd-daemon0 libsystemd-journal0 libsystemd-login0 libtar0 libtinyxml2-0.0.0 libts-0.0-0 libupstart-app-launch2 liburcu1 libusageenvironment1 libx264-142 linux-headers-3.13.0-100 linux-headers-3.13.0-100-generic linux-image-3.13.0-100-generic linux-image-extra-3.13.0-100-generic m17n-contrib oem-kernel-cmdline python-requests qtdeclarative5-friends0.2 qtdeclarative5-qtmultimedia-plugin tsconf ttf-dejavu-extra Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: linux-generic linux-headers-4.4.0-51 linux-headers-4.4.0-51-generic linux-headers-generic 0 upgraded, 0 newly installed, 4 to remove and 5 not upgraded. 5 not fully installed or removed. After this operation, 77.8 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 296731 files and directories currently installed.) Removing linux-generic (4.4.0.51.54) ... Removing linux-headers-generic (4.4.0.51.54) ... Removing linux-headers-4.4.0-51-generic (4.4.0-51.72) ... Removing linux-headers-4.4.0-51 (4.4.0-51.72) ... Setting up initramfs-tools (0.122ubuntu8.5) ... update-initramfs: deferring update (trigger activated) Setting up linux-image-4.4.0-51-generic (4.4.0-51.72) ... Running depmod. update-initramfs: deferring update (hook will be called later) The link /initrd.img is a dangling linkto /boot/initrd.img-4.4.0-51-generic vmlinuz(/boot/vmlinuz-4.4.0-51-generic ) points to /boot/vmlinuz-4.4.0-51-generic (/boot/vmlinuz-4.4.0-51-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.4.0-51-generic.postinst line 491. Examining /etc/kernel/postinst.d. run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic N: Ignoring file '50unattended-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension N: Ignoring file '50unattended-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension N: Ignoring file '50unattended-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension 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 Error! The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch. This indicates that it should not be built. Error! The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch. This indicates that it should not be built. 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 E: /usr/share/initramfs-tools/hooks/casper-memdisk failed with return 1. update-initramfs: failed for /boot/initrd.img-4.4.0-51-generic with 1. run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1 Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.4.0-51-generic.postinst line 1052. dpkg: error processing package linux-image-4.4.0-51-generic (--configure): subprocess installed post-installation script returned error exit status 2 dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-51-generic: linux-image-extra-4.4.0-51-generic depends on linux-image-4.4.0-51-generic; however: Package linux-image-4.4.0-51-generic is not configured yet. dpkg: error processing package linux-image-extra-4.4.0-51-generic (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of linux-image-generic: linux-image-generic depends on linux-image-4.4.0-51-generic; however: Package linux-image-4.4.0-51-generic is not configured yet. linux-image-generic depends on linux-image-extra-4.4.0-51-generic; however: Package linux-image-extra-4.4.0-51-generic is not configured yet. dpkg: error processing package linux-image-generic (--configure): dependency problems - leaving unconfigured Processing triggers for initramfs-tools (0.122ubuntu8.5) ... No apport report written because the error message indicates its a followup error from a previous failure. No apport report written because the error message indicates its a followup error from a previous failure. update-initramfs: Generating /boot/initrd.img-3.13.0-101-generic E: /usr/share/initramfs-tools/hooks/casper-memdisk failed with return 1. update-initramfs: failed for /boot/initrd.img-3.13.0-101-generic with 1. dpkg: error processing package initramfs-tools (--configure): subprocess installed post-installation script returned error exit status 1 No apport report written because MaxReports is reached already Errors were encountered while processing: linux-image-4.4.0-51-generic linux-image-extra-4.4.0-51-generic linux-image-generic initramfs-tools N: Ignoring file '50unattended-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension E: Sub-process /usr/bin/dpkg returned an error code (1) sudo apt remove linux-image-extra-4.4.0-51-generic Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: aptitude-common g++-4.8 giblib1 heirloom-mailx icedtea-netx icedtea-netx-common libass4 libatk-wrapper-java libatk-wrapper-java-jni libavcodec54 libavformat54 libavutil52 libbasicusageenvironment0 libboost-iostreams1.54.0 libdee-qt5-3 libdirac-encoder0 libdvbpsi8 libept1.4.12 libgif4 libgroupsock1 liblivemedia23 libmagickcore5 libmagickwand5 libopenjpeg2 libpostproc52 libstdc++-4.8-dev libswscale2 libsystemd-daemon0 libsystemd-journal0 libsystemd-login0 libtar0 libtinyxml2-0.0.0 libts-0.0-0 libupstart-app-launch2 liburcu1 libusageenvironment1 libx264-142 linux-headers-3.13.0-100 linux-headers-3.13.0-100-generic linux-image-3.13.0-100-generic linux-image-extra-3.13.0-100-generic m17n-contrib oem-kernel-cmdline python-requests qtdeclarative5-friends0.2 qtdeclarative5-qtmultimedia-plugin thermald tsconf ttf-dejavu-extra Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: linux-image-extra-4.4.0-51-generic linux-image-generic 0 upgraded, 0 newly installed, 2 to remove and 5 not upgraded. 4 not fully installed or removed. After this operation, 161 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 270069 files and directories currently installed.) Removing linux-image-generic (4.4.0.51.54) ... Removing linux-image-extra-4.4.0-51-generic (4.4.0-51.72) ... run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-51-generic /boot/vmlinuz-4.4.0-51-generic N: Ignoring file '50unattended-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension N: Ignoring file '50unattended-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension N: Ignoring file '50unattended-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension 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 Error! The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch. This indicates that it should not be built. Error! The dkms.conf for this module includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch. This indicates that it should not be built. 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 E: /usr/share/initramfs-tools/hooks/casper-memdisk failed with return 1. update-initramfs: failed for /boot/initrd.img-4.4.0-51-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-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 N: Ignoring file '50unattended-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension E: Sub-process /usr/bin/dpkg returned an error code (1)