如何删除 CentOS 6 更新后产生的多余的内核?
第一种方法:通过命令的方式解决多余的内核
1.首先查看当前内核的版本号:
[root@jxatei ~]# uname -a
Linux jxatei.server2.6.32-573.1.1.el6.x86_64 #1 SMP Sat Jul 25 17:05:50 UTC 2015 x86_64 x86_64x86_64 GNU/Linux
2.查询系统中全部的内核:
[root@jxatei ~]# rpm -qa|grep kernel
kernel-2.6.32-504.30.3.el6.x86_64
kernel-headers-2.6.32-573.1.1.el6.x86_64
kernel-2.6.32-573.1.1.el6.x86_64
kernel-2.6.32-504.el6.x86_64
dracut-kernel-004-388.el6.noarch
kernel-firmware-2.6.32-573.1.1.el6.noarch
3. 以上是我CentOS的内核版本号,其中红色为要删除的版本号:
[root@jxatei ~]# yum remove kernel-2.6.32-504.30.3.el6.x86_64
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_640:2.6.32-504.30.3.el6 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================
Removing:
kernel x86_64 2.6.32-504.30.3.el6 @updates 124 M
Transaction Summary
=============================================================================================================================
Remove 1 Package(s)
Installed size: 124 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Repository base is listed more thanonce in the configuration
Repository updates is listed morethan once in the configuration
Repository extras is listed more thanonce in the configuration
Repository centosplus is listed morethan once in the configuration
Repository contrib is listed morethan once in the configuration
Erasing:kernel-2.6.32-504.30.3.el6.x86_64 1/1 Verifying:kernel-2.6.32-504.30.3.el6.x86_64 1/1 Removed:
kernel.x86_64 0:2.6.32-504.30.3.el6 Complete!
4.重启后就可以看到,内核被删掉了,同时多余的启动项也自动被删掉了。
重启系统后,可以通过查看以下两个文件是否还有多余内核代码:
[root@jxatei ~]#vi /boot/grub/grub.conf
[root@jxatei ]# vi /boot/grub/menu.lst
第二种方法:通过修改“menu.lst”文件,删除红色部分来解决多余的内核
[root@jxatei ~]# vi /boot/grub/menu.lst
# grub.confgenerated by anaconda
#
# Note thatyou do not have to rerun grub after making changes to this
file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths arerelative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version roroot=/dev/sda3
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS(2.6.32-573.1.1.el6.x86_64)
root (hd0,0)
"/boot/grub/menu.lst"25L, 1368C
# grub.confgenerated by anaconda
#
# Note thatyou do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths arerelative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version roroot=/dev/sda3
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS(2.6.32-573.1.1.el6.x86_64)
root (hd0,0)
kernel/vmlinuz-2.6.32-573.1.1.el6.x86_64 roroot=UUID=72640132-d6de-46b4-bceb-c7fff46de559 rd_NO_LUKS KEYBOARDTYPE=
pc KEYTABLE=usrd_NO_MD crashkernel=auto.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
initrd/initramfs-2.6.32-573.1.1.el6.x86_64.img
titleCentOS (2.6.32-504.30.3.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-504.30.3.el6.x86_64ro root=UUID=72640132-d6de-46b4-bceb-c7fff46de559 rd_NO_LUKS KEYBOARDTYPE =pc KEYTABLE=us rd_NO_MDcrashkernel=auto.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet initrd/initramfs-2.6.32-504.30.3.el6.x86_64.img
第三种方法:通过修改”grub.cfg”文件解决多余的内核
[root@jxatei ~]#vi /boot/grub/grub.conf
# grub.confgenerated by anaconda
#
# Note thatyou do not have to rerun grub after making changes to this
file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths arerelative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version roroot=/dev/sda3
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS(2.6.32-573.1.1.el6.x86_64)
root (hd0,0)
"grub.conf"17L, 755C
# grub.confgenerated by anaconda
#
# Note thatyou do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths arerelative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version roroot=/dev/sda3
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS(2.6.32-573.1.1.el6.x86_64)
root (hd0,0)
kernel/vmlinuz-2.6.32-573.1.1.el6.x86_64 roroot=UUID=72640132-d6de-46b4-bceb-c7fff46de559 rd_NO_LUKS KEYBOARDTYPE=
pc KEYTABLE=usrd_NO_MD crashkernel=auto.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
initrd/initramfs-2.6.32-573.1.1.el6.x86_64.img ~
小结,其实第二、三种方法非常相似,都是修改文件,而且内容都是一样的。sky建议,如果我们要成为Linux专家,只有多使用命令的习惯性操作。
如何删除 CentOS 6 更新后产生的多余的内核?的更多相关文章
- 删除 CentOS7 更新后产生的多余的内核
今天更新完系统的内核,重启电脑时发现突然多了一个启动项,想删除多余的启动项,在上网查找后,找到了下面的方法,经过测试,是完全可行的.自己写下来,以便以后用到.1.# uname -a 列出系统中正在使 ...
- CentOS 7 内核更新后删除旧内核(转载)
CentOS 7 内核更新后删除旧内核 0.当前 # uname -sr Linux 3.10.0-123.20.1.el7.x86_64 1.搜索查询 # rpm -q kernel kernel- ...
- WIN10下VS CODE 更新后拓展宿主意外终止问题解决方法(每次系统更新都要删除一次git)
S CODE最近更新后,一打开就会出现拓展宿主意外终止的错误,点重新加载等都不好用. 出现这个问题主要是和git有关,做如下操作处理就好: 打开vscode安装文件夹->resource文件夹- ...
- 删除LINUX更新后多余的内核
删除LINUX更新后多余的内核 本人使用的时fredoa 21 之前为了搞网卡驱动不知不觉升级了几次系统,每次启动后都有好几个内核让我选,真的非常头疼阿,尤其像博主这样的有点强迫的人,看着就心烦,所以 ...
- H5+app,自动更新后自动删除安装包
H5+app 自动删除安装包 一.前言 之前做好的app自动更新,遗留下了一个问题,就是自动更新后安装包没有自行删除掉. 好像现在的手机的系统是有安装完自动清理安装包的.想我这个H5+的app安装完后 ...
- MYSQL删除表的记录后如何使ID从1开始
MYSQL删除表的记录后如何使ID从1开始 MYSQL删除表的记录后如何使ID从1开始 http://hi.baidu.com/289766516/blog/item/a3f85500556e2c09 ...
- LINQ To SQL在N层应用程序中的CUD操作、批量删除、批量更新
原文:LINQ To SQL在N层应用程序中的CUD操作.批量删除.批量更新 0. 说明 Linq to Sql,以下简称L2S. 以下文中所指的两层和三层结构,分别如下图所示: 准确的说,这里 ...
- 网站简介-为什么网站的ICO图标更新后,ie浏览器没有更新过来?
为什么网站的ICO图标更新后,ie浏览器没有更新过来? 如何更新本地ico图标? 收藏夹里的网址访问后网站ico小图标怎么不会更新,还是没图标的. 如果制作了一个新的favicon.ico图标,并且已 ...
- IOS7 新特性(针对同样讨厌更新后IOS7的开发者)
本文转载至 http://blog.csdn.net/hanbing861210/article/details/13614211 您还未登录!|登录|注册|帮助 首页 业界 移动 云计算 研发 论坛 ...
随机推荐
- Maven项目实战(1)
一.maven的好处? 同样的项目使用maven工程来实现,它的项目源码很小: 1.依赖管理 就是对jar 包管理的过程 2.项目的一键构建 (编译-----测试----- 运行 --打包------ ...
- java---集合类(1)
java.util包中包含了一系列重要的集合类.而对于集合类,主要需要掌握的就是它的内部结构,以及遍历集合的迭代模式. 接口:Collection Collection是最基本的集合接口,一个Coll ...
- ZOJ 2671 Cryptography 矩阵乘法+线段树
B - Cryptography Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Subm ...
- php中的PCRE 函数,正则表达式处理函数。
有时候在一些特定的业务场景中需要匹配,或者提取一些关键的信息,例如匹配网页中的一些链接, 提取一些数据时,可能会用到正则匹配. 下面介绍一下php中的一些常用的正则处理函数. 一.preg_repla ...
- Ext.net Calendar 控件在有模板页的时候,模板页定义了TD的样式造成日历控件的样式丢掉
Ext.net Calendar 控件在有模板页的时候,模板页定义了TD的样式造成日历控件的样式丢掉 解决方案 在本页面添加下面的样式 <style type="text/css&qu ...
- Flutter起步之安装
官网有介绍的这里就不说,主要有几个步骤: 镜像设置 下载flutter SDK(更新系统环境变量PATH,先不要运行flutter doctor,因为你还没有装android sdk和编辑器) and ...
- 转载-【深度学习】深入理解Batch Normalization批标准化
全文转载于郭耀华-[深度学习]深入理解Batch Normalization批标准化: 文章链接Batch Normalization: Accelerating Deep Network T ...
- poj3667(线段树区间合并&区间查询)
题目链接: http://poj.org/problem?id=3667 题意:第一行输入 n, m表示有 n 间房间(连成一排的), 接下来有 m 行输入, 对于接下来的 m 行输入: 1 x : ...
- 洛谷P3293 [SCOI2016]美味(主席树)
传送门 据说这题做法叫做可持久化trie树?(然而我并不会) 首先考虑一下贪心,从高位到低位枚举,如果能选1肯定比选0优 假设已经处理到了$b$的第$i$位,为1(为0的话同理就不说了) 那么只有当$ ...
- java模拟多线程
public class HTTPRequest implements Runnable { public void run() { //这里实现发送请求 } public static void ...