CentOS 7 升级内核
参考地址:How to Install or Upgrade to Kernel 4.19 in CentOS 7
Step 1: Checking Installed Kernel Version
- 查看当前版本
$ uname -sr
Step 2: Upgrading Kernel in CentOS 7
- To enable the ELRepo repository on CentOS 7:
$ 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
- 查看可用的最新版本列表
$ yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
- Install the latest mainline stable kernel:
$ yum --enablerepo=elrepo-kernel install kernel-ml
-
重启,选择刚安装的内核开机登录
-
登录成后,查看版本
$ uname -sr
Linux 4.19.8-1.el7.elrepo.x86_64
Step 3: Set Default Kernel Version in GRUB
- 修改GRUB配置文件
$ cd /etc/default/
$ vim grub
- 修改 GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DEFAULT=0 //修改此项
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
- 使GRUB配置文件生效
$ grub2-mkconfig -o /boot/grub2/grub.cfg
- 重启,默认开机内核便是最新内核了