1. 查看网口相关信息
[root@server ~]# ethtool -i ens33
driver: e1000 # 网卡类型
version: 7.3.21-k8-NAPI # 版本
firmware-version:
expansion-rom-version:
bus-info: 0000:02:01.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no
2. 查看已存在内核
[root@server ~]# awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
CentOS Linux (3.10.0-1160.42.2.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-1062.el7.x86_64) 7 (Core)
CentOS Linux (0-rescue-1215237edc174249988f1203c4b1d355) 7 (Core)
3. 添加需要版本的内核
# 内核下载地址 http://mirror.rackspace.com/elrepo/kernel/el7/x86_64/RPMS/
# 可以自行下载传入服务器 也可以使用 wget进行下载
[root@server ~]# rpm -ivh kernel-lt-5.4.180-1.el7.elrepo.x86_64.rpm
[root@server ~]# awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
CentOS Linux (5.4.180-1.el7.elrepo.x86_64) 7 (Core) # 新增的内核
CentOS Linux (3.10.0-1160.42.2.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-1062.el7.x86_64) 7 (Core)
CentOS Linux (0-rescue-1215237edc174249988f1203c4b1d355) 7 (Core)
4. 查看默认的内核版本并设置新的默认内核
[root@server ~]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-1160.42.2.el7.x86_64) 7 (Core)
[root@server ~]# grub2-set-default 'CentOS Linux (5.4.180-1.el7.elrepo.x86_64) 7 (Core)' # 设置新的内核版本
[root@server ~]# grub2-editenv list # 再次查看
saved_entry=CentOS Linux (5.4.180-1.el7.elrepo.x86_64) 7 (Core)