# 查看已经在启动列表的内核 cat /boot/grub/grub.cfg | grep "menuentry 'Ubuntu," | awk -F '--class' '{print $1} menuentry 'Ubuntu, with Linux 5.10.87-051087-generic' menuentry 'Ubuntu, with Linux 5.10.87-051087-generic (recovery mode)' menuentry 'Ubuntu, with Linux 5.4.187-0504187-generic' menuentry 'Ubuntu, with Linux 5.4.187-0504187-generic (recovery mode)' menuentry 'Ubuntu, with Linux 4.15.0-163-generic' menuentry 'Ubuntu, with Linux 4.15.0-163-generic (recovery mode)' menuentry 'Ubuntu, with Linux 4.15.0-162-generic' menuentry 'Ubuntu, with Linux 4.15.0-162-generic (recovery mode)' # 修改/etc/default/grub 找到 GRUB_DEFAULT 行,并将其值设置为所选择的内核版本的完整名称或索引号。 vi /etc/default/grub GRUB_DEFAULT='Ubuntu, with Linux 4.15.0-162-generic' # 更新grub,重启主机生效 update-grub