centos7内核更新
uname -a #check the current version cat /etc/redhat-release #check current kernel verison rpm -qa | grep kernel #check the current kernel verison that has been installed #查看是否有关于内核的源,elrepo(RPM repository for Enterprise Linux package),其实是个企业级Linux的仓库,这里只用到内核包,所以称为内核源 yum install https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm #yum install kernel repo yum info --enablerepo=elrepo-kernel kernel-lt kernel-ml #check infomation of kernel-lt and kernel-ml rpm -qa | grep kernel #check the current verison of kernel yum remove $(rpm -qa | grep kernel | grep -v $(uname -r)) #remove the specify verison of kernel-tools and kernel-tools-libs #LT Version(Long term support version) # Install LT Version yum install --enablerepo=elrepo-kernel -y kernel-lt kernel-lt-headers kernel-lt-devel kernel-lt-tools kernel-lt-tools-libs # Install ML Version #yum install --enablerepo=elrepo-kernel -y kernel-ml kernel-ml-headers kernel-ml-devel kernel-ml-tools kernel-ml-tools-libs rpm -qa | grep kernel #check the kernel you have installed grub2-mkconfig -o /boot/grub2/grub.cfg #rebuild configuration of grub2(Optional operation) awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg #check the useful kernel that you hav installed #选择需要启动的内核 grub2-set-default 0 yum update时不升级内核 vi /etc/yum.conf #最下面加个* exclude=kernel*
#内核相关的包说明: #kernel-lt #The Linux kernel. (The core of any Linux-based operating system.) #最核心的包,所有Linux系统的基础 #kernel-lt-devel #Development package for building kernel modules to match the kernel. #内核开发包,更多是提供给内核开发人员开发内核的一些功能模块 #kernel-lt-doc #Various bits of documentation found in the kernel sources. #内核包的指引文档 #kernel-lt-headers #Header files of the kernel, for use by glibc. #内核的头文件,一般其他应用需要调用内核能力就要引入这些头文件 #kernel-lt-tools #Assortment of tools for the kernel. #内核级别的一些工具 #kernel-lt-tools-libs #Libraries for the kernel tools. #内核级别工具所依赖的包 #kernel-lt-tools-libs-devel #Development package for the kernel tools libraries. #内核级别工具开发所需的依赖包