在/boot目录下有很多vmlinuz.*文件,追溯到4年前。删除其中一些是否安全?
编辑:大多数似乎还有与之配套的congig-3.*和System.map.*文件。我可能也想摆脱它们?还是选择其他方式?
编辑:大多数似乎还有与之配套的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 autoclean
和sudo apt-get clean
命令? - A.B.autoremove
会删除不再需要的旧软件包,这些软件包是自动安装的(例如依赖项)。clean
会删除由apt-get下载的所有本地缓存的.deb文件。autoclean
与clean
相同,但只会删除那些已过时的.deb文件(服务器上不再提供的版本)。因此,autoclean
包含在clean
中,两者都不会触及已安装的软件包,只会清理缓存的.deb文件(如果你愿意,可以称它们为安装文件)。 - Byte Commandersudo apt-get uninstall
和通配符删除了最旧的内核。如果操作错误可能会有风险,但否则是有效的。
dpkg -S /usr/src/*
http://askubuntu.com/questions/301466/files-are-piling-up-in-usr-src-how-can-i-stop-this 根据14.04版本的设定,应该只保留2个内核,但不确定在我的系统上是否有效。请查看 /etc/kernel/postinst.d/apt-auto-removal。 - oldfred