remove linux kernel
2009-05-11 15:20
225 查看
How to: Linux delete or remove kernel
by Vivek GiteQ. I have multiple
versions installed and I need to save disk space. I am using Cent OS
Linux. How can I delete or remove a Linux kernel from my Linux
distribution ?
A. Linux Kernel and related files are stored in following locations:
=> /boot - Stores actual kernel and related file such system man and initrd images,
=> /etc or /boot/grub - Stores grub.conf file (most distro use /boot/grub these days).
=> /iib/modules/KERNEL-VERSION/* - Linux device drivers (modules)
If kernel is installed using binary package system such as rpm, yum,
up2date, apt-get etc you can remove with following commands:
Rpm based distro - Red Hat/CentOS/Fedora Core/Suse Linux
First find out all installed kernel version with following command:# rpm -qa | grep kernel-smp
or
# rpm -qa | grep kernel
Output:
kernel-smp-2.6.9-42.EL kernel-smp-2.6.9-42.0.3.EL kernel-smp-2.6.9-42.0.8.EL
I've total 3 different kernel installed. To remove kernel-smp-2.6.9-42.EL type command:
# rpm -e kernel-smp-2.6.9-42.EL
OR
# rpm -vv -e kernel-smp-2.6.9-42.EL
.deb based distro - Debian or Ubuntu Linux
Again find out all installed kernel version:$ dpkg --list | grep kernel-image
Output:
ii kernel-image-2.4.27-2-386 2.4.27-10sarge1 Linux kernel image for version 2.4.27 on 386 ii kernel-image-2.6.8-2-686 2.6.8-16sarge1 Linux kernel image for version 2.6.8 on PPro
Now remove kernel-image-2.4.27-2-386 with apt-get command itself:
# apt-get remove kernel-image-2.4.27-2-386
OR
$ sudo apt-get remove kernel-image-2.4.27-2-386
If you have custom compiled kernel you need to remove following files/dirs:
/boot/vmlinuz*KERNEL-VERSION*
/boot/initrd*KERNEL-VERSION*
/boot/System-map*KERNEL-VERSION*
/boot/config-*KERNEL-VERSION*
/lib/modules/*KERNEL-VERSION*/
Update grub configuration file /etc/grub.conf or /boot/grub/menu.lst to point to correct kernel version.
相关文章推荐
- How to: Linux delete or remove kernel
- Understanding the linux kernel-ch4-Interrupt and exception
- Linux kernel oops
- Understanding the linux kernel-ch4-Interrupt Handling
- Linux kernel boot process——从实模式(real mode)到保护模式(protected mode),再到分页(paging)
- [Linux]Linux kernel log里的时间单位
- linux kernel gic 介绍
- VirtualBox + kgdb analysis of Linux kernel (v3.4.0-rc3)
- cramfs patch for bad block (kernel version linux-2.6.32.17) cramfs 坏块补丁
- BUG_ON & WARN_ON in Linux Kernel
- Linux内核编译过程详解(kernel2.6.7) 转
- LINICE2.6 - Linux Kernel Debugger
- “rmdir: failed to remove ‘tmp’: Directory not empty”解决方案–Linux命令行如何删除非空文件夹
- linux kernel log 级别设置
- Linux kernel I2C设备总结
- 面试题:2014百度 linux中大内核锁(BKL--Big Kernel Lock)和自旋锁(FIFO Ticket Spinlock)
- -Linux Kernel SMP&nbsp…
- ANALYSIS AND EXPLOITATION OF A LINUX KERNEL VULNERABILITY (CVE-2016-0728)
- Linux kernel version dirty
- [转]Hacking the Linux Kernel Network Stack(译本)