centos7安装高版本内核
因为一些调试及测试需要,我们的centos需要安装高版本内核以便进行BCC和BPF的实时调试功能。
成都服务器托管,成都创新互联提供包括服务器租用、绵阳服务器托管、带宽租用、云主机、机柜租用、主机租用托管、CDN网站加速、域名注册等业务的一体化完整服务。电话咨询:18980820575
下面是我的安装过程:
查看当前OS版本
cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
安装elrepo
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
列出elrepo-kernel相关的软件包
[root@localhost /root ] # yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* elrepo-kernel: mirrors.tuna.tsinghua.edu.cn
Available Packages
elrepo-release.noarch 7.0-4.el7.elrepo elrepo-kernel
kernel-lt.x86_64 4.4.212-1.el7.elrepo elrepo-kernel
kernel-lt-devel.x86_64 4.4.212-1.el7.elrepo elrepo-kernel
kernel-lt-doc.noarch 4.4.212-1.el7.elrepo elrepo-kernel
kernel-lt-headers.x86_64 4.4.212-1.el7.elrepo elrepo-kernel
kernel-lt-tools.x86_64 4.4.212-1.el7.elrepo elrepo-kernel
kernel-lt-tools-libs.x86_64 4.4.212-1.el7.elrepo elrepo-kernel
kernel-lt-tools-libs-devel.x86_64 4.4.212-1.el7.elrepo elrepo-kernel
kernel-ml-doc.noarch 5.5.0-1.el7.elrepo elrepo-kernel
kernel-ml-headers.x86_64 5.5.0-1.el7.elrepo elrepo-kernel
kernel-ml-tools.x86_64 5.5.0-1.el7.elrepo elrepo-kernel
kernel-ml-tools-libs.x86_64 5.5.0-1.el7.elrepo elrepo-kernel
kernel-ml-tools-libs-devel.x86_64 5.5.0-1.el7.elrepo elrepo-kernel
perf.x86_64 5.5.0-1.el7.elrepo elrepo-kernel
python-perf.x86_64 5.5.0-1.el7.elrepo elrepo-kernel
安装相关的内核包:
yum --enablerepo=elrepo-kernel install kernel-ml kernel-ml-devel.x86_64
查看当前存在的内核版本
[root@localhost /root ] # sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : CentOS Linux (5.5.0-1.el7.elrepo.x86_64) 7 (Core)
1 : CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)
2 : CentOS Linux (3.10.0-862.11.6.el7.x86_64) 7 (Core)
3 : CentOS Linux (3.10.0-862.el7.x86_64) 7 (Core)
4 : CentOS Linux (0-rescue-81b73827307a43799b9968e81edddb2f) 7 (Core)
设置5.5.0的内核为默认启动项
grub2-set-default 0
grub2-mkconfig -o /boot/grub2/grub.cfg
重启系统
reboot
再次查看
[root@localhost /root ] # uname -r
5.5.0-1.el7.elrepo.x86_64
[root@localhost /root ] # uname -a
Linux localhost 5.5.0-1.el7.elrepo.x86_64 #1 SMP Sun Jan 26 20:12:30 EST 2020 x86_64 x86_64 x86_64 GNU/Linux
本文名称:centos7安装高版本内核
链接地址:http://myzitong.com/article/gesegc.html