一般情况下,在我们分区的时候,boot的目录都不会太大,一般默认的好像之后100M(我自己分了一个200M,不够用,早知道分大一点了),因为考虑到只是一些配置文件,我在分区的时候也没有太注意,也就是随意搞了一个200M,结果在升级几次内核之后就发现问题了,boot满了。于是乎就在网上找了几种解决方案:
使用如下yum或在rpm命令进行卸载不必要的内核:
Remove old unused kernel automatically
Using package-cleanup
command which is a part of yum-utils
package we can uninstall any number of old kernels automatically. As an example using --oldkernels --count=2
option with package-cleanup
command the command will remove all unused kernel while keeping last three most recent kernel versions installed.
Let’s remove all kernels expect the latest currently loaded kernel:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # package-cleanup --oldkernels --count=1 Loaded plugins: fastestmirror --> Running transaction check ---> Package kernel.x86_64 0:3.10.0-327.36.3.el7 will be erased ---> Package kernel.x86_64 0:3.10.0-514.2.2.el7 will be erased --> Finished Dependency Resolution Dependencies Resolved ======================================================================================================================================================================================================================= Package Arch Version Repository Size ======================================================================================================================================================================================================================= Removing: kernel x86_64 3.10.0-327.36.3.el7 @anaconda 136 M kernel x86_64 3.10.0-514.2.2.el7 @updates 148 M Transaction Summary ======================================================================================================================================================================================================================= Remove 2 Packages Installed size: 284 M Is this ok [y/N]: |
参考:
https://blog.csdn.net/wangganggelian/article/details/49848305
https://linuxconfig.org/how-to-remove-old-unused-kernels-on-centos-linux