安装时内核 5.13.0-27 安装在安装时失败 - 下一步该怎么办?

安装时内核 5.13.0-27 安装在安装时失败 - 下一步该怎么办?

我运行sudo apt upgrade后输出如下。我现在该做什么?我之前的内核被覆盖了吗?我避免关闭我的机器,因为我担心它现在可能无法启动。

Setting up linux-firmware (1.187.25) ...
update-initramfs: Generating /boot/initrd.img-5.11.0-46-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/vgubuntu-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.11.0-46-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned error exit status 1

然后是一些与其他通用包相关的行,然后:

Processing triggers for linux-image-5.13.0-27-generic (5.13.0-27.29~20.04.1) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.13.0-27-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.13.0-27-generic
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/vgubuntu-swap_1)
I: Set the RESUME variable to override this.
Error 24 : Write error : cannot write compressed block
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.13.0-27-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.13.0-27-generic (--configure):
 installed linux-image-5.13.0-27-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-firmware
 linux-image-5.13.0-27-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

按照以下方法解决回答类似问题

看起来是旧内核的问题。让我们一起一步步解决这个问题。

首先,清除所有不再使用或导致错误的旧内核:

 dpkg -l | egrep "linux-(signed|modules|image|headers)" | grep -v $(uname -r | cut -d - -f 1) | awk {'print $2'} | xargs sudo apt purge -y

再次运行 apt -f:

sudo apt --fix-broken install

然后我跑了 sudo apt upgrade,一切都顺利进行。

相关内容