Ubuntu 20.04 linux-firmware 安装错误(mkinitramfs 失败)

Ubuntu 20.04 linux-firmware 安装错误(mkinitramfs 失败)

不久前,我通过 GUI 更新程序安装了更新,然后出现了错误,类似于 linux-firmware 安装后脚本失败。老实说,我很高兴之后盒子仍然正常启动,所以我就放手了。但现在我正在安装从终端下载的 deb 包,我再次看到了与 linux-firmware 安装相关的错误。

我在日志中看到这个:

dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-firmware; however:
Package linux-firmware is not configured yet.

我在这里找到一篇帖子尝试一下sudo dpkg --configure -a,但错误是一样的。

以下是上述命令的完整日志:

Setting up initramfs-tools (0.136ubuntu6.4) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-firmware (1.187.10) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-66-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/ubuntu--vg-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.4.0-66-generic with 1.
dpkg: error processing package linux-firmware (--configure):
installed linux-firmware package post-installation script subprocess returned error exit status 1
Setting up linux-image-5.4.0-67-generic (5.4.0-67.75) ...
I: /boot/initrd.img.old is now a symlink to initrd.img-5.4.0-67-generic
Setting up linux-image-5.4.0-70-generic (5.4.0-70.78) ...
I: /boot/initrd.img is now a symlink to initrd.img-5.4.0-70-generic
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-firmware; however:
Package linux-firmware is not configured yet.

dpkg: error processing package linux-image-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 5.4.0.70.73); however:
Package linux-image-generic is not configured yet.

dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.136ubuntu6.4) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-66-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/ubuntu--vg-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.4.0-66-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
installed initramfs-tools package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.4.0-67-generic (5.4.0-67.75) ...
/etc/kernel/postinst.d/dkms:
* dkms: running auto installation service for kernel 5.4.0-67-generic
...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-67-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/ubuntu--vg-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.4.0-67-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.4.0-67-generic (--configure):
installed linux-image-5.4.0-67-generic package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.4.0-70-generic (5.4.0-70.78) ...
/etc/kernel/postinst.d/dkms:
* dkms: running auto installation service for kernel 5.4.0-70-generic
...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-70-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/ubuntu--vg-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.4.0-70-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.4.0-70-generic (--configure):
installed linux-image-5.4.0-70-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
linux-firmware
linux-image-generic
linux-generic
initramfs-tools
linux-image-5.4.0-67-generic
linux-image-5.4.0-70-generic

所以我猜问题在于mkinitramfs

Error 24 : Write error : cannot write compressed block 
E: mkinitramfs failure cpio 141 lz4 -9 -l 24

我在 Dell Precision 5540 上运行 ubuntu,并按照本指南设置 FDEhttps://help.ubuntu.com/community/Full_Disk_Encryption_Howto_2019但我不知道这是否有关系。

看到固件配置问题有点可怕,所以我想解决它,以免将来导致更大的问题。

答案1

我也遇到过同样的问题,这个答案帮助过我。

我的/boot镜像很小,我需要清除一个以前的 Linux 镜像,以便腾出空间来initramfs-tools完成。使用 检查/boot并删除一个或多个旧镜像包apt purge。例如:

sudo apt purge linux-image-5.4.0-42-generic

这也会触发 initramfs-tools,因此我的下一步apt upgrade就清楚了。

autoremove升级后定期进行检查应保持/boot清晰:

sudo apt autoremove

对于那些固执的人:

sudo apt autoremove --purge

这是帮助文档描述更多细节。

相关内容