Which kernel version will be booted next time?

One approach is to parse the default kernel from GRUB configurations. The default GRUB menu entry can be detected, for example:

grep GRUB_DEFAULT /etc/default/grub | cut -d '=' -f 2

Then get the menu entries from GRUB config, like:

grep -A 15 '^menuentry' /boot/grub/grub.cfg | grep -o -P 'vmlinuz-\S+'

Source: How to get the kernel version of the next boot from a script – Unix & Linux Stack Exchange

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.