第一种方法:通过命令的方式解决多余的内核

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 更新后产生的多余的内核?的更多相关文章

  1. 删除 CentOS7 更新后产生的多余的内核

    今天更新完系统的内核,重启电脑时发现突然多了一个启动项,想删除多余的启动项,在上网查找后,找到了下面的方法,经过测试,是完全可行的.自己写下来,以便以后用到.1.# uname -a 列出系统中正在使 ...

  2. CentOS 7 内核更新后删除旧内核(转载)

    CentOS 7 内核更新后删除旧内核 0.当前 # uname -sr Linux 3.10.0-123.20.1.el7.x86_64 1.搜索查询 # rpm -q kernel kernel- ...

  3. WIN10下VS CODE 更新后拓展宿主意外终止问题解决方法(每次系统更新都要删除一次git)

    S CODE最近更新后,一打开就会出现拓展宿主意外终止的错误,点重新加载等都不好用. 出现这个问题主要是和git有关,做如下操作处理就好: 打开vscode安装文件夹->resource文件夹- ...

  4. 删除LINUX更新后多余的内核

    删除LINUX更新后多余的内核 本人使用的时fredoa 21 之前为了搞网卡驱动不知不觉升级了几次系统,每次启动后都有好几个内核让我选,真的非常头疼阿,尤其像博主这样的有点强迫的人,看着就心烦,所以 ...

  5. H5+app,自动更新后自动删除安装包

    H5+app 自动删除安装包 一.前言 之前做好的app自动更新,遗留下了一个问题,就是自动更新后安装包没有自行删除掉. 好像现在的手机的系统是有安装完自动清理安装包的.想我这个H5+的app安装完后 ...

  6. MYSQL删除表的记录后如何使ID从1开始

    MYSQL删除表的记录后如何使ID从1开始 MYSQL删除表的记录后如何使ID从1开始 http://hi.baidu.com/289766516/blog/item/a3f85500556e2c09 ...

  7. LINQ To SQL在N层应用程序中的CUD操作、批量删除、批量更新

    原文:LINQ To SQL在N层应用程序中的CUD操作.批量删除.批量更新 0. 说明 Linq to Sql,以下简称L2S.    以下文中所指的两层和三层结构,分别如下图所示: 准确的说,这里 ...

  8. 网站简介-为什么网站的ICO图标更新后,ie浏览器没有更新过来?

    为什么网站的ICO图标更新后,ie浏览器没有更新过来? 如何更新本地ico图标? 收藏夹里的网址访问后网站ico小图标怎么不会更新,还是没图标的. 如果制作了一个新的favicon.ico图标,并且已 ...

  9. IOS7 新特性(针对同样讨厌更新后IOS7的开发者)

    本文转载至 http://blog.csdn.net/hanbing861210/article/details/13614211 您还未登录!|登录|注册|帮助 首页 业界 移动 云计算 研发 论坛 ...

随机推荐

  1. Java中的数组和方法

    3.1 数组的定义和使用 数组(Array)是用来存储一组相同数据类型数据的集合.数组中的每个数据称为一个元素(element),数组可以分为一维数组,二维数组和多维数组.我们 主要讲解一维数组和二维 ...

  2. JS极品日历

    <!DOCTYPE><html><head><meta http-equiv="Content-Type" content="t ...

  3. Auto Layout Guide----(一)-----Understanding Auto Layout

    Understanding Auto Layout 理解自动布局 Auto Layout dynamically calculates the size and position of all the ...

  4. 细说 CSS margin

    作者:https://coding.net/u/zhengkenghong原文:https://blog.coding.net/blog/css-margin 细说 CSS margin 本文着重描述 ...

  5. ASP.NET Core分布式项目实战

    ASP.NET Core开发者成长路线图 asp.net core 官方文档 https://docs.microsoft.com/zh-cn/aspnet/core/getting-started/ ...

  6. 8. php回调后门

    中国菜刀下载,基于原版中国菜刀优化版20160309. 下载地址: http://pan.baidu.com/s/1jHoJxHW China chopper http://pan.baidu.com ...

  7. linux下 卸载vmtools

    注意事项: 1) 安装linux时,一定要安装gcc和kernel-source: 2)光驱使用完毕可使用 umount /mnt/cdrom 卸载掉 3)VMtools 默认安装在 /usr/bin ...

  8. CF 148D D Bag of mice (概率dp)

    题目链接 D. Bag of mice time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  9. py-kms使用方法

    搭建py-kms服务器,先下载py-kms https://github.com/myanaloglife/py-kms 启动py-kms服务(需要服务器安装有python): python serv ...

  10. laravel ajax提交登陆存储session,并输出

    前端输出session {{ Session::get('username') }} ajax提交 <div>{{ Session::get('username') }}</div& ...