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

Mat*_*att 6 boot 12.04

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

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

Sté*_*ane 5

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

sudo apt-get autoremove
Run Code Online (Sandbox Code Playgroud)

更新:我找到了一个虚拟机,几周内我没有运行这些命令。这是输出,显示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/
Run Code Online (Sandbox Code Playgroud)

  • `autoremove` 会自动删除不再需要的旧安装包(例如作为依赖项)。`clean` 删除 apt-get 下载的所有本地缓存​​的 .deb 文件。`autoclean` 与 `clean` 的作用相同,但只删除那些过时的 .deb 文件(服务器上不再可用的版本)。因此,`autoclean` 包含在 `clean` 中,并且两者都不涉及已安装的软件包,仅涉及缓存的 .debs(如果需要,可以将它们称为安装文件)。 (3认同)