Linux 固件升级因 /boot 已满而失败?

Linux 固件升级因 /boot 已满而失败?

期间sudo apt upgrade我收到以下错误。同样在sudo apt autoremove --purge

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up linux-firmware (1.187.11) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-72-generic
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-72-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 installed linux-firmware package post-installation script subprocess returned e
rror exit status 1
Errors were encountered while processing:
 linux-firmware
E: Sub-process /usr/bin/dpkg returned an error code (1)

问题可能是/boot已使用 90%。但如果自动移除功能不起作用,我该如何释放空间?

uname -r显示:5.4.0-70-generic

内容/boot如下:

-rw-r--r--  1 root root  1395166 Jan 20  2017 abi-4.9.5-040905-generic
-rw-r--r--  1 root root   201072 Jan 20  2017 config-4.9.5-040905-generic
-rw-r--r--  1 root root   237850 Mär 19 12:57 config-5.4.0-70-generic
-rw-r--r--  1 root root   237851 Mär 24 11:25 config-5.4.0-71-generic
-rw-r--r--  1 root root   237851 Apr 12 17:12 config-5.4.0-72-generic
drwx------  3 root root     4096 Jan  1  1970 efi/
drwxr-xr-x  5 root root     1024 Apr 19 08:17 grub/
lrwxrwxrwx  1 root root       27 Apr 19 08:16 initrd.img -> initrd.img-5.4.0-72-generic
-rw-r--r--  1 root root 17015451 Jul 13  2020 initrd.img-4.4.0-101-generic
-rw-r--r--  1 root root 61223879 Mär 15 13:29 initrd.img-4.9.5-040905-generic
-rw-r--r--  1 root root 88225085 Apr 14 09:07 initrd.img-5.4.0-70-generic
-rw-r--r--  1 root root 88228245 Apr 14 09:08 initrd.img-5.4.0-71-generic
-rw-r--r--  1 root root 88227938 Apr 19 08:17 initrd.img-5.4.0-72-generic
lrwxrwxrwx  1 root root       27 Apr 19 08:16 initrd.img.old -> initrd.img-5.4.0-71-generic
drwx------  2 root root    12288 Mai  3  2017 lost+found/
-rw-r--r--  1 root root   182704 Aug 18  2020 memtest86+.bin
-rw-r--r--  1 root root   184380 Aug 18  2020 memtest86+.elf
-rw-r--r--  1 root root   184884 Aug 18  2020 memtest86+_multiboot.bin
-rw-------  1 root root  3639920 Jan 20  2017 System.map-4.9.5-040905-generic
-rw-------  1 root root  4749710 Mär 19 12:57 System.map-5.4.0-70-generic
-rw-------  1 root root  4750202 Mär 24 11:25 System.map-5.4.0-71-generic
-rw-------  1 root root  4750202 Apr 12 17:12 System.map-5.4.0-72-generic
lrwxrwxrwx  1 root root       24 Apr 19 08:16 vmlinuz -> vmlinuz-5.4.0-72-generic
-rw-------  1 root root  7403296 Jan 20  2017 vmlinuz-4.9.5-040905-generic
-rw-------  1 root root 11756288 Mär 19 13:01 vmlinuz-5.4.0-70-generic
-rw-------  1 root root 11760384 Mär 24 11:29 vmlinuz-5.4.0-71-generic
-rw-------  1 root root 11760384 Apr 12 18:56 vmlinuz-5.4.0-72-generic
lrwxrwxrwx  1 root root       24 Apr 19 08:16 vmlinuz.old -> vmlinuz-5.4.0-71-generic

apt autoremove问题:如果不能自行删除,哪些文件可以安全删除?

更新

$ dpkg -l "linux*" |grep "ii"
ii  linux-base                              4.5ubuntu3.1         all          Linux image base package
ii  linux-firmware                          1.187.11             all          Firmware for Linux kernel drivers
ii  linux-generic                           5.4.0.72.75          amd64        Complete Generic Linux kernel and headers
ii  linux-generic-lts-utopic                4.4.0.131.137        amd64        Complete Generic Linux kernel and headers (dummy transitional package)
ii  linux-headers-5.4.0-70                  5.4.0-70.78          all          Header files related to Linux kernel version 5.4.0
ii  linux-headers-5.4.0-70-generic          5.4.0-70.78          amd64        Linux kernel headers for version 5.4.0 on 64 bit x86 SMP
ii  linux-headers-5.4.0-71                  5.4.0-71.79          all          Header files related to Linux kernel version 5.4.0
ii  linux-headers-5.4.0-71-generic          5.4.0-71.79          amd64        Linux kernel headers for version 5.4.0 on 64 bit x86 SMP
ii  linux-headers-5.4.0-72                  5.4.0-72.80          all          Header files related to Linux kernel version 5.4.0
ii  linux-headers-5.4.0-72-generic          5.4.0-72.80          amd64        Linux kernel headers for version 5.4.0 on 64 bit x86 SMP
ii  linux-headers-generic                   5.4.0.72.75          amd64        Generic Linux kernel headers
ii  linux-image-5.4.0-70-generic            5.4.0-70.78          amd64        Signed kernel image generic
ii  linux-image-5.4.0-71-generic            5.4.0-71.79          amd64        Signed kernel image generic
ii  linux-image-5.4.0-72-generic            5.4.0-72.80          amd64        Signed kernel image generic
ii  linux-image-generic                     5.4.0.72.75          amd64        Generic Linux kernel image
ii  linux-libc-dev:amd64                    5.4.0-72.80          amd64        Linux Kernel Headers for development
ii  linux-modules-5.4.0-70-generic          5.4.0-70.78          amd64        Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
ii  linux-modules-5.4.0-71-generic          5.4.0-71.79          amd64        Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
ii  linux-modules-5.4.0-72-generic          5.4.0-72.80          amd64        Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
ii  linux-modules-extra-5.4.0-70-generic    5.4.0-70.78          amd64        Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
ii  linux-modules-extra-5.4.0-71-generic    5.4.0-71.79          amd64        Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
ii  linux-modules-extra-5.4.0-72-generic    5.4.0-72.80          amd64        Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
ii  linux-signed-generic                    4.15.0.129.116       amd64        Complete Signed Generic Linux kernel and headers (dummy transitional package)
ii  linux-signed-generic-lts-utopic         4.4.0.131.137        amd64        Complete Signed Generic Linux kernel and headers (dummy transitional package)
ii  linux-sound-base                        1.0.25+dfsg-0ubuntu5 all          base package for ALSA and OSS sound systems

$ uname -r
5.4.0-70-generic

答案1

/boot 中的大部分内容都是内核,您可以尝试手动删除旧内核和内核头文件。请务必先阅读帖子并提出您的任何问题,删除错误的内核将导致您的系统无法启动。

首先检查Linux 标头Linux 映像已安装 dpkg -l "linux*" |grep "ii"

你不应该删除当前的内核,建议保留当前和以前的内核,其余的可以删除;

apt-get remove <kernel_package_name>

务必仔细检查将要删除的软件包如果有疑问,请在继续之前询问。

相关内容