How Do I Change the Kernel Version Loaded?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
INeedABetterUserName
Level 1
Level 1
Posts: 26
Joined: Sun Nov 29, 2015 7:42 pm

How Do I Change the Kernel Version Loaded?

Post by INeedABetterUserName » Wed Dec 05, 2018 5:27 pm

Hello. I am trying to force a newer kernel version to load everytime the system is loaded. (For example: Changing from 4.15.0-20 to 4.15.0-21) I've installed the new kernel update but it still runs the older version. I am using "uname -r" to check what version is running. I can load a different kernel version via the grub menu (either via the advanced menu selection or by editing the default OS menu option), but that only works for one session. I want it to default on the newer kernel for every boot. I'd prefer not to use the Grub Customizer software. Any ideas? Thanks.

User avatar
Pjotr
Level 20
Level 20
Posts: 11065
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: How Do I Change the Kernel Version Loaded?

Post by Pjotr » Wed Dec 05, 2018 5:39 pm

Multiboot system with another Linux? If so, check the dominant Grub.
Tip: 10 things to do after installing Linux Mint 19.1 Tessa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

User avatar
dbunkerd
Level 1
Level 1
Posts: 1
Joined: Sun Jun 08, 2014 10:40 pm
Location: Bangkok
Contact:

Re: How Do I Change the Kernel Version Loaded?

Post by dbunkerd » Wed Dec 05, 2018 9:30 pm

What sends noobs running back to Windows?
Pjotr wrote:
Wed Dec 05, 2018 5:39 pm
Multiboot system with another Linux? If so, check the dominant Grub.
This ^

User avatar
all41
Level 14
Level 14
Posts: 5021
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How Do I Change the Kernel Version Loaded?

Post by all41 » Wed Dec 05, 2018 11:00 pm

Is there more than one hd involved here?
Boot into the Mint that has the updated kernel and run:
sudo grub-install /dev/sdX
make sure to substitute the correct drive for sdX
You can find the correct drive designation with the Drives utility in the Menu

This will become the dominant grub and will boot to the latest installed kernel
Proud to be a supporter and monthly contributor to Mint.

INeedABetterUserName
Level 1
Level 1
Posts: 26
Joined: Sun Nov 29, 2015 7:42 pm

Re: How Do I Change the Kernel Version Loaded?

Post by INeedABetterUserName » Thu Dec 06, 2018 3:16 am

Thanks for the info. Yes, there's multiple Linux OS's installed and I don't think the OS I was working with is the dominant one. So basically there's no good way to alter the kernel that boots permanently without switching the grubs back and forth to make them dominant?

I actually had this issue a while back and was editing the OS menu option text to make it load the newer kernel. It was basically the same text you would see on the edit screen on the grub, when you try to edit a specific OS selection. However, this was done through the grub customizer software, which i'm trying to now avoid. From what I have seen through some brief research, it looks like the /etc/default/grub is the only file being recommened for editing but that only covers some basic stuff. Some of the other files, like /boot/grub/grub.cfg, compile there info from other files and your not supposed to edit them.

PS: Thanks for the site Pjotr.

User avatar
slipstick
Level 5
Level 5
Posts: 809
Joined: Sun Oct 21, 2012 9:56 pm
Location: Somewhere on the /LL0 scale

Re: How Do I Change the Kernel Version Loaded?

Post by slipstick » Thu Dec 06, 2018 4:54 am

Here's the only other way I can think of to do this, and I'm not sure it will work - haven't tried it myself. This assumes that your two OS's are both Mint (or Ubuntu) and installed in UEFI mode. In UEFI, the boot-loader in the /boot/efi/EFI/Ubuntu directory uses the file /boot/efi/EFI/Ubuntu/grub.cfg to point to the partition with the file /boot/grub/grub.cfg which produces the Grub menu with the appropriate kernel. For example, on my system, this /boot/efi/EFI/Ubuntu/grub.cfg file is:

Code: Select all

search.fs_uuid ea610a0d-cc22-4e6a-ade2-48029233a620 root hd0,gpt11 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
So maybe you could have two copies of /boot/efi/EFI/Ubuntu/grub.cfg, one pointing to the partition with the /boot/grub/grub.cfg for system #1 and the other one pointing to the partition with /boot/grub/grub.cfg for system # 2. I think you would only have to change the UUID and partition number in the first line. Then on the system #1 desktop you could put a launcher for a script file which would overwrite /boot/efi/EFI/Ubuntu/grub.cfg with the file pointing to /boot/grub/grub.cfg for system # 2, and on the system #2 desktop you would put a launcher for a script file to substitute the file pointing to system #1. So if you are in system #1, and want to go to system #2 and make it dominant, you just launch your script file and reboot - grub will use the system #2 /boot/grub/grub.cfg menu, and similarly to go the other way.

I don't know enough about MBR booting to figure out how you would do this on that type system, and as I said, I'm not even positive this would work for UEFI - I could be overlooking something obvious. :)
In theory, theory and practice are the same. In practice, they ain't.

User avatar
Pjotr
Level 20
Level 20
Posts: 11065
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: How Do I Change the Kernel Version Loaded?

Post by Pjotr » Thu Dec 06, 2018 4:58 am

dbunkerd wrote:
Wed Dec 05, 2018 9:30 pm
What sends noobs running back to Windows?
Pjotr wrote:
Wed Dec 05, 2018 5:39 pm
Multiboot system with another Linux? If so, check the dominant Grub.
This ^
Bollocks. Noobs typically don't have multiboot systems with more than one Linux.
Tip: 10 things to do after installing Linux Mint 19.1 Tessa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.

User avatar
all41
Level 14
Level 14
Posts: 5021
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: How Do I Change the Kernel Version Loaded?

Post by all41 » Thu Dec 06, 2018 11:05 am

INeedABetterUserName wrote:
Thu Dec 06, 2018 3:16 am
Thanks for the info. Yes, there's multiple Linux OS's installed and I don't think the OS I was working with is the dominant one. So basically there's no good way to alter the kernel that boots permanently without switching the grubs back and forth to make them dominant?

I actually had this issue a while back and was editing the OS menu option text to make it load the newer kernel. It was basically the same text you would see on the edit screen on the grub, when you try to edit a specific OS selection. However, this was done through the grub customizer software, which i'm trying to now avoid. From what I have seen through some brief research, it looks like the /etc/default/grub is the only file being recommened for editing but that only covers some basic stuff. Some of the other files, like /boot/grub/grub.cfg, compile there info from other files and your not supposed to edit them.

PS: Thanks for the site Pjotr.
I have one system with 5 MInt partitions on 3 hd.
As I update kernels on each system I do sudo grub-install /dev/sdb
where sdb is the drive containing my preferred os and also at the top of the bios boot order.
This brings that os to the top of the grub. I boot to it again to make sure the new kernel is installed and check
a few things to make sure there is no obvious conflicts.
After this I reboot and select my preferred os at grub boot screen, and after boot
redo sudo grub-install /dev/sdb to return that os to the top of the grub list.

You can install additional OSs without a bootloader using ubiquity -b option
Proud to be a supporter and monthly contributor to Mint.

User avatar
zcot
Level 3
Level 3
Posts: 158
Joined: Wed Oct 19, 2016 6:08 pm

Re: How Do I Change the Kernel Version Loaded?

Post by zcot » Thu Dec 06, 2018 3:10 pm

alternately..

-just boot to the OS that is controlling the grub and: sudo update-grub

INeedABetterUserName
Level 1
Level 1
Posts: 26
Joined: Sun Nov 29, 2015 7:42 pm

Re: How Do I Change the Kernel Version Loaded?

Post by INeedABetterUserName » Sat Dec 08, 2018 4:24 pm

all41 wrote:
Thu Dec 06, 2018 11:05 am
As I update kernels on each system I do sudo grub-install /dev/sdb
I can't get this to work. Post Updated: Now able to install grub, as I had to install it to the drive letter, not parition (was giving error message). Ran sudo update-grub after. Didn't seem to do anything to the grub and the menu order is the same. Installed grub on the non-linux OS drive, as I think that is where it was installed orginally for the OS I am trying to update. That did change it to a different grub, with the OS I wanted to update at the top, but it's still the older kernel loading.
all41 wrote:
Thu Dec 06, 2018 11:05 am
You can install additional OS's without a bootloader using ubiquity -b option
That would allow the newest kernels to load for all OS's? If so, that seems like it's probably the best option in the future.
zcot wrote:
Thu Dec 06, 2018 3:10 pm
just boot to the OS that is controlling the grub and: sudo update-grub
That will update the list of kernels in the Grub (advanced options menu) however the default kernel loaded for me remains unchanged.

Thanks!

User avatar
zcot
Level 3
Level 3
Posts: 158
Joined: Wed Oct 19, 2016 6:08 pm

Re: How Do I Change the Kernel Version Loaded?

Post by zcot » Sat Dec 08, 2018 10:51 pm

Wow. I don't know.

Installing a new kernel should automatically update the files correctly and update grub so you get the new files. A problem when that might not happen is depending on multiple grub installs or which system is in control of that which is all of everything mentioned above.

If you've gotten a correct handle on the right grub, and all that was successful, then the source of the issue must be within the newly updated kernel situation, which doesn't really seem logical since you can boot that new kernel manually without any issues.

no, clue. lol. :shock: Maybe someone can help dig deeper on it.

install 'boot-info-script' with software manager, or whatever the method, and run sudo bootinfoscript and share that result here(enclose in code tags please).

hcentaur13
Level 3
Level 3
Posts: 170
Joined: Sat May 18, 2013 5:13 pm

Re: How Do I Change the Kernel Version Loaded?

Post by hcentaur13 » Sun Dec 09, 2018 8:09 am

When you have more than only 1 linux on a single computzuer you have multigle grub installed too!

1. grub as bootmanger to list all bootable systems. This does nothing than list all bootable systems. install/update grub will replace it to boot the linux it is installed from as default. igt is sitting in MBR rrespective /efi. It does not boot an OS itself. It is ony used to select an OS, but boots up the bootloader of the selected OS.
2. grub to boot the linux it is installed on. This is sitting in /boot. It does all needed to boot up the OS it sits on.

grub-install installs grub in MBR respectiver /efi to get grub as bootselector installed. Then it installs grub as bootloader for the workling linux to get kernel up and running when booting it. It lets all oher grub on other linuxes untouched.
update-grub writes only the grub in MBR respective /efi new und creates the bootselector new, setting the bootmenu of grub in MBR respective /efi on the first place.

grub is a selector that selects between different OSes. It is sitting in MBR, respective /efi. It does nothing than to select which OS is to boot and boots up its bootloader.
grub is a bootloader for a linux. It sits in /boot to get kernel and filesystems up and running.

Post Reply

Return to “Newbie Questions”