无法安装内核

无法安装内核

我正在遵循本指南https://kernelnewbies.org/OutreachyfirstpatchSetup当我尝试安装内核时,它失败了:

update-initramfs: Generating /boot/initrd.img-5.9.0
W: Possible missing firmware /lib/firmware/i915/rkl_dmc_ver2_01.bin for module i915
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.9.0 with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
make[1]: *** [arch/x86/boot/Makefile:160: install] Error 1
make: *** [arch/x86/Makefile:274: install] Error 2

但它很可能与 /boot 空间无关,因为:

Filesystem                  Size  Used Avail Use% Mounted on
tmpfs                       2,4G  2,1M  2,4G   1% /run
/dev/mapper/vgkubuntu-root  232G  201G   19G  92% /
tmpfs                        12G   16K   12G   1% /dev/shm
tmpfs                       5,0M  4,0K  5,0M   1% /run/lock
tmpfs                       4,0M     0  4,0M   0% /sys/fs/cgroup
/dev/nvme0n1p2              705M  153M  501M  24% /boot
/dev/nvme0n1p1              511M   44M  468M   9% /boot/efi
tmpfs                       2,4G   80K  2,4G   1% /run/user/1000

我可以在那里创建并保存文件(名为 test):

4,0K .                        244K config-5.9.0      4,0K grub                         180K memtest86+.bin            5,4M System.map-5.8.0-63-generic  4,0K test                       12M vmlinuz-5.9.0
4,0K ..                       244K config-5.9.0.old   90M initrd.img-5.8.0-63-generic  184K memtest86+.elf            5,2M System.map-5.9.0                0 vmlinuz                    12M vmlinuz-5.9.0.old
244K config-5.8.0-63-generic  4,0K efi                16K lost+found                   184K memtest86+_multiboot.bin  5,2M System.map-5.9.0.old          14M vmlinuz-5.8.0-63-generic     0 vmlinuz.old

当前运行 5.8.0-63-generic

有人可以帮我吗?

答案1

遇到了同样的问题,解决方法如下:

$ sudo rm /var/lib/dpkg/info/linux-firmware.*

作为记录,一些法证。我收到的错误消息是:

$ sudo apt upgrade
...
Setting up linux-firmware (1.200+system76~1632347857~21.04~9a6d09b) ...
update-initramfs: Generating /boot/initrd.img-5.11.0-7633-generic
cryptsetup: WARNING: Resume target cryptswap uses a key file
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-7633-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-firmware
E: Sub-process /usr/bin/dpkg returned an error code (1)

基本上每个 apt 命令(安装、自动删除等)都会出现此错误

/boot 中有 41 MB 空闲空间。无法通过删除一些(带有sudo apt-get remove linux-image-5.4.0-7642-generic或类似的)来释放更多空间,因为它遇到了同样的问题。

关于我的系统:

$  lsb_release -a
No LSB modules are available.
Distributor ID: Pop
Description:    Pop!_OS 21.04
Release:    21.04
Codename:   hirsute

$ uname -a
Linux thinkpad 5.11.0-7633-generic #35~1630100930~21.04~ae2753e-Ubuntu SMP Mon Aug 30 18:26:54 UTC  x86_64 x86_64 x86_64 GNU/Linux

通过删除以下文件解决问题:

$ cd /var/lib/dpkg/info

$ ls -l linux-firmware.*
-rw-r--r-- 1 root root 119010 Sep 29 19:42 linux-firmware.list
-rw-r--r-- 1 root root 179422 Sep 22 23:57 linux-firmware.md5sums
-rwxr-xr-x 1 root root    105 Sep 22 23:57 linux-firmware.postinst

$ cat linux-firmware.postinst 
#!/bin/sh

set -e

if [ -x /usr/sbin/update-initramfs ]; then
    /usr/sbin/update-initramfs -u -k all
fi

(当然,我将它们移至 /tmp 而不是仅仅删除它们)

这里建议了解决方案:https://itsfoss.com/dpkg-returned-an-error-code-1/

相关内容