sudo apt-get purge linux-image-x.x.x-x-generic
does not work
Unable to install anything as in synaptics, because there is no space on boot.
I get a message that boot has 0 bytes available.
After reading certain posts about this, I tried removing some of the old kernels, but each time I try, I get an error message saying that I should run apt-get -f install
When I try to run that, it says, I don't have enough space to run that command:
userone@userone:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
linux-image-extra-4.4.0-98-generic
0 to upgrade, 0 to newly install, 1 to remove and 28 not to upgrade.
3 not fully installed or removed.
After this operation, 153 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 476523 files and directories currently installed.)
Removing linux-image-extra-4.4.0-98-generic (4.4.0-98.121) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-98-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-98-generic /boot/vmlinuz-4.4.0-98-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-98-generic /boot/vmlinuz-4.4.0-98-generic
Error! Your kernel headers for kernel 4.4.0-98-generic cannot be found.
Please install the linux-headers-4.4.0-98-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-98-generic cannot be found.
Please install the linux-headers-4.4.0-98-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-98-generic cannot be found.
Please install the linux-headers-4.4.0-98-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-98-generic /boot/vmlinuz-4.4.0-98-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-98-generic
WARNING: missing /lib/modules/4.4.0-98-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-98-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_sLktUc/lib/modules/4.4.0-98-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_sLktUc/lib/modules/4.4.0-98-generic/modules.builtin: No such file or directory
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-98-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-98-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-4.4.0-98-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
userone@userone:~$ ×
Any idea how to fix this issue?