zoukankan      html  css  js  c++  java
  • CentOS7清理老旧内核

    CentOS7如果是一步步内核升级上来的将会面临一个问题(一般安装了图形化界面的系统常见),由于内核增多/boot/的容量减少,导致启动变慢。这时就需要清理老旧内核,释放/boot/空间。

    使用uname -r查看内核版本

    [root@localhost ~]# uname -r
    3.10.0-957.el7.x86_64

    接着使用rpm -q kernel查看系统内所有的内核

    rpm -qa | grep kernel
    kernel-tools-libs-3.10.0-957.21.3.el7.x86_64
    kernel-3.10.0-957.21.3.el7.x86_64
    kernel-3.10.0-957.el7.x86_64
    kernel-headers-3.10.0-957.21.3.el7.x86_64
    kernel-tools-libs-3.10.0-957.el7.x86_64
    kernel-tools-3.10.0-957.21.3.el7.x86_64

    相互对照,将老旧内核使用yum remove命令删除

    [root@localhost ~]# yum remove kernel-3.10.0-957.21.3.el7.x86_64
    Loaded plugins: fastestmirror
    Resolving Dependencies
    --> Running transaction check
    ---> Package kernel.x86_64 0:3.10.0-957.21.3.el7 will be erased
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ===========================================================================================================================================================================
     Package                              Arch                                 Version                                           Repository                               Size
    ===========================================================================================================================================================================
    Removing:
     kernel                               x86_64                               3.10.0-957.21.3.el7                               installed                                63 M
    
    Transaction Summary
    ===========================================================================================================================================================================
    Remove  1 Package
    
    Installed size: 63 M
    Is this ok [y/N]: y
    Downloading packages:
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Erasing    : kernel-3.10.0-957.21.3.el7.x86_64                                                                                                                       1/1 
      Verifying  : kernel-3.10.0-957.21.3.el7.x86_64                                                                                                                       1/1 
    
    Removed:
      kernel.x86_64 0:3.10.0-957.21.3.el7                                                                                                                                      
    
    Complete!

    再次查看 启动菜单

     vi /etc/grub2.cfg

    发现已经没有了这个错误的启动选项,问题解决成功!

  • 相关阅读:
    hoj2677 Instruction Set // poj3253Fence Repair 哈夫曼树
    hoj 1067 Rails //poj1363 Rails 栈的简单应用
    hoj 1004 Prime Palindromes 回文素数
    hoj 1152 The Blocks Problem 模拟题 模拟栈
    hoj 1640 Mobile phones //poj 1195 Mobile phones 二维树状数组
    poj 1611 The Suspects // hoj 1564 The Suspects 并查集
    poj1276Cash Machine 二进制将多重背包转化为01背包
    poj 1001Exponentiation 高精度
    time函数(转)
    gtk_statusbar(转)
  • 原文地址:https://www.cnblogs.com/littlehb/p/11204992.html
Copyright © 2011-2022 走看看