当从终端登录 Ubuntu ,发现提示:
New release '24.04.1 LTS' available. Run 'do-release-upgrade' to upgrade to it.
执行:
do-release-upgrade
如果提示 /boot 空间不足:
Not enough free disk space The upgrade has aborted. The upgrade needs a total of 251 M free space on disk '/boot'. Please free at least an additional 24.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 分区中的空间。 您所要做的就是输入:
sudo apt autoremove
这不仅会删除未使用的内核,还会消除您不需要或任何安装的工具都不需要的依赖项。
如果依然不足:
查看当前内核:
uname -r
输出:
5.15.0-119-generic
使用 rm 命令使用以下命令从启动分区中删除特定无用内核(每个命令一个命令):
sudo rm /boot/initrd.img-5.15.0-94-generic sudo rm /boot/vmlinuz-5.15.0-94-generic