stephane@steph-dev-vm ~> du -hs /boot/
127M /boot/
stephane@steph-dev-vm ~> sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.16.0-30 linux-headers-3.16.0-30-generic linux-image-3.16.0-30-generic
linux-image-extra-3.16.0-30-generic
Use 'apt-get autoremove' to remove them.
stephane@steph-dev-vm ~> sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-headers-3.16.0-30 linux-headers-3.16.0-30-generic linux-image-3.16.0-30-generic
linux-image-extra-3.16.0-30-generic
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
After this operation, 281 MB disk space will be freed.
Do you want to continue? [Y/n] y
...
Found linux image: /boot/vmlinuz-3.16.0-31-generic
Found initrd image: /boot/initrd.img-3.16.0-31-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
stephane@steph-dev-vm ~> du -hs /boot/
96M /boot/
如果您运行以下命令,它们将被自动删除:
更新:我找到了一个 VM,我已经有几周没有在其中运行这些命令了。下面是输出,显示
autoremove
清理了 /boot 中的文件,大小从 127M 减少到 96M:答案似乎是安装了很多内核,我应该删除它们。
我删除了最旧的使用
sudo apt-get uninstall
和通配符。如果你弄错了会有风险,但在其他方面是有效的。