从/ boot中删除旧的vmlinuz。*文件是否安全

/boot有很多vmlinuz.*文件可以追溯到4年前。 删除其中一些是否安全?

编辑:大多数似乎都有congig-3.*System.map.*文件。 我可能也想摆脱那些? 或者相反?

如果您运行以下命令,它们将自动删除:

 sudo apt-get autoremove 

更新:我找到了一个我几周没有运行这些命令的虚拟机。 这是输出,显示autoremove清理/ boot中的文件,从127M大小下降到96M大小:

 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/ 

答案似乎是安装了很多内核,我应该删除它们。

我使用sudo apt-get uninstall和外卡删除了最旧的。 如果你弄错了但其他方面有效,那就冒险吧。