CentOS7 updates the Linux kernel

1. View the current kernel version

 uname -r
Copy the code

2. Install EPEL source

 yum install -y epel-release
 rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
 rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
 yum update
Copy the code

Install the kernel

 yum --enablerepo=elrepo-kernel list all |grep kernel
 yum --enablerepo=elrepo-kernel install kernel-ml kernel-ml-tools kernel-ml-header
Copy the code

Viewing the System Kernel

 [root@CentOS ~]# egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d '
 CentOS Linux (5.4.7-1.el7.elrepo.x86_64) 7 (Core)
 CentOS Linux (3.10.0-1062.9.1.el7.x86_64) 7 (Core)
 CentOS Linux (3.10.0-693.21.1.el7.x86_64) 7 (Core)
 CentOS Linux (3.10.0-693.el7.x86_64) 7 (Core)
 CentOS Linux (0-rescue-8f930081116c4c29bda2a2f6aff35c68) 7 (Core)
 ​
 [root@CentOS ~]# rpm -qa | grep kernelThe kernel - 3.10.0-693.21.1. El7. X86_64 kernel - ml - tools - also 5.4.7-1. El7. Elrepo. X86_64 kernel - 3.10.0-1062.9.1. El7. X86_64 The kernel - ml - also 5.4.7-1. El7. Elrepo. X86_64 kernel - 3.10.0-693. El7. X86_64 abrt addon - kerneloops - 2.1.11-55. El7. Centos. X86_64 The kernel - ml - devel - also 5.4.7-1. El7. Elrepo. X86_64 kernel - ml - tools - libs - also 5.4.7-1. El7. Elrepo. X86_64Copy the code

Select the latest kernel boot system

 # default 0 indicates that the first kernel is set to run by default, so select the latest kernel
 [root@CentOS ~]# grub2-set-default 0
Copy the code

4. Restart the system

 reboot
Copy the code

Check the kernel

 [root@CentOS ~]# uname -rAlso 5.4.7-1. El7. Elrepo x86_64Copy the code

Uninstall the old kernel

 yum remove kernel
Copy the code

If virtualization software is running, you need to install kenel-ML-headers

Enable BBR acceleration

 [root@CentOS ~]# echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
 [root@CentOS ~]# echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
 [root@CentOS ~]# sysctl -p
 net.core.default_qdisc = fq
 net.ipv4.tcp_congestion_control = bbr
Copy the code

Check the BBR module

 [root@CentOS ~]# lsmod |grep bbr
 tcp_bbr                20480  1
 [root@CentOS ~]# sysctl net.ipv4.tcp_available_congestion_control
 net.ipv4.tcp_available_congestion_control = reno cubic bbr
 [root@CentOS ~]# sysctl net.ipv4.tcp_congestion_control
 net.ipv4.tcp_congestion_control = bbr
Copy the code

Refer to the link

Elrepo.org/tiki/tiki-i… Unixetc.com/post/linux_… Elrepo.org/linux/kerne… teddysun.com/623.html