无法删除旧内核以释放 /boot 上的空间

无法删除旧内核以释放 /boot 上的空间

sudo apt-get purge linux-image-x.x.x-x-generic不起作用

无法安装任何东西,如在 synaptics 中,因为启动时没有空间。

我收到一条消息,提示启动时有 0 个可用字节。

在阅读了一些关于此问题的帖子后,我尝试删除一些旧内核,但每次尝试时,我都会收到一条错误消息,提示我应该运行apt-get -f install

当我尝试运行该命令时,它说我没有足够的空间来运行该命令:

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:~$ ×

知道如何修复这个问题吗?

相关内容