After rebooting my Ubuntu 16.04 machine, I noticed that the kernel version had changed. From what I understand, I think that out of the available kernels inside /boot, any of the modules can be loaded on reboot.

I want a particular kernel version to be loaded on every reboot, not the latest one.

Here is the list of files present in /boot.

-rw------- 1 root root 6.9M Feb 13  2018 vmlinuz-4.4.0-116-generic
-rw------- 1 root root 3.8M Feb 13  2018 System.map-4.4.0-116-generic
-rw-r--r-- 1 root root 2.7K Feb 13  2018 retpoline-4.4.0-116-generic
-rw-r--r-- 1 root root 187K Feb 13  2018 config-4.4.0-116-generic
-rw-r--r-- 1 root root 1.2M Feb 13  2018 abi-4.4.0-116-generic
-rw-r--r-- 1 root root  11M Mar 20  2018 initrd.img-4.4.0-116-generic
-rw------- 1 root root 6.9M Aug 15 17:48 vmlinuz-4.4.0-134-generic
-rw------- 1 root root 3.8M Aug 15 17:48 System.map-4.4.0-134-generic
-rw-r--r-- 1 root root  255 Aug 15 17:48 retpoline-4.4.0-134-generic
-rw-r--r-- 1 root root 187K Aug 15 17:48 config-4.4.0-134-generic
-rw-r--r-- 1 root root 1.2M Aug 15 17:48 abi-4.4.0-134-generic
drwxr-xr-x 5 root root 4.0K Aug 31 07:39 grub
-rw-r--r-- 1 root root  16M Aug 31 07:42 initrd.img-4.4.0-134-generic

How can I achieve this?

marked as duplicate by WinEunuuchs2Unix, karel, Charles Green, Eric Carvalho, Thomas Nov 17 '18 at 9:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    @Zanna Clarifying more on my question, what i want is this : Lets say my ubuntu machine has two kernels x and y where x is latest. I want that on every reboot kernel y is loaded – a874 Nov 14 '18 at 6:11

This is what I do on CentOS, which still uses grub so shouldnt be any different. It was taken from https://wiki.centos.org/HowTos/Grub2

The following will output a list of entries:

awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg

to see current default entry: grub2-editenv list

Now this will change the default entry to the list entry you printed earlier on:

grub2-set-default 2

And to confirm: grub2-editenv list

  • I very much doubt it's the same on Ubuntu... – Zanna Nov 13 '18 at 19:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.