grub2 set default kernel

awk -F\’ /^menuentry/{print\$2} /etc/grub2.cfg

Fedora (4.14.16-300.fc27.x86_64) 27 (Twenty Seven)
Fedora (4.14.14-300.fc27.x86_64) 27 (Twenty Seven)
Fedora (4.12.13-300.fc26.x86_64) 27 (Twenty Seven)
Fedora (0-rescue-fbb0c4896a9c0f680475c0a07edd2c5a) 27 (Twenty Seven)

grub2-set-default 2
cat /boot/grub2/grubenv |grep saved
saved_entry=2

cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg_backup -v
grub2-mkconfig -o /boot/grub2/grub.cfg

Generating grub configuration file …
Found linux image: /boot/vmlinuz-4.14.16-300.fc27.x86_64
Found initrd image: /boot/initramfs-4.14.16-300.fc27.x86_64.img
Found linux image: /boot/vmlinuz-4.14.14-300.fc27.x86_64
Found initrd image: /boot/initramfs-4.14.14-300.fc27.x86_64.img
Found linux image: /boot/vmlinuz-4.12.13-300.fc26.x86_64
Found initrd image: /boot/initramfs-4.12.13-300.fc26.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-fbb0c4896a9c0f680475c0a07edd2c5a
Found initrd image: /boot/initramfs-0-rescue-fbb0c4896a9c0f680475c0a07edd2c5a.img
done

Leave a Reply

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