You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 22.04升级至24.04时/boot分区磁盘空间不足的问题求助

Ubuntu 22.04升级至24.04时/boot分区磁盘空间不足的问题求助

各位好,我在把Ubuntu 22.04升级到24.04的过程中卡壳了——升级直接中止,弹出了下面的错误提示:

The upgrade has aborted. The upgrade needs a total of 239 M free space
on disk '/boot'. Please free at least an additional 39.1 M of disk
space on '/boot'. You can remove old kernels using 'sudo apt
autoremove' and you could also set COMPRESS=xz in
/etc/initramfs-tools/initramfs.conf to reduce the size of your
initramfs.

我先查了下/boot分区的空间使用情况,执行命令df -h /boot后得到的输出是:

root@localhost # df -h /boot
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       468M  242M  191M  56% /boot

接着我又列出了/boot目录下的所有文件,执行ls -lah /boot的结果如下:

total 235M
drwxr-xr-x  4 root root 4.0K Oct 29 10:41 .
drwxr-xr-x 20 root root 4.0K Dec  1  2022 ..
-rw-r--r--  1 root root 256K Jul  5 09:53 config-5.15.0-118-generic
-rw-r--r--  1 root root 256K Sep 27 18:21 config-5.15.0-124-generic
drwxr-xr-x  4 root root 4.0K Oct 18 06:08 grub
lrwxrwxrwx  1 root root   29 Oct 18 06:07 initrd.img -> initrd.img-5.15.0-124-generic
-rw-r--r--  1 root root 100M Oct 29 10:41 initrd.img-5.15.0-118-generic
-rw-r--r--  1 root root 101M Oct 18 06:07 initrd.img-5.15.0-124-generic
-rw-r--r--  1 root root 179K Jul  5 09:53 memtest86+.bin
-rw-r--r--  1 root root 181K Jul  5 09:53 memtest86+.elf
-rw-r--r--  1 root root 181K Jul  5 09:53 memtest86+_multiboot.bin
-rw-------  1 root root 5.7M Jul  5 09:53 System.map-5.15.0-118-generic
-rw-------  1 root root 5.7M Sep 27 18:21 System.map-5.15.0-124-generic
-rw-------  1 root root 11.6M Jul  5 09:53 vmlinuz-5.15.0-118-generic
-rw-------  1 root root 11.6M Sep 27 18:21 vmlinuz-5.15.0-124-generic

我按照提示试了sudo apt autoremove,但释放的空间好像不够,还是达不到升级需要的239M空闲空间。想问问各位有没有其他靠谱的方法,能快速给/boot分区腾出足够的空间,让我顺利完成升级?麻烦大家支个招,谢谢!

备注:内容来源于stack exchange,提问作者Mateusz

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 13:59:51