How to keep apt from installing grub-common?

Folks:

I have a plucky install running in a multi-boot machine where another OS is handling osprober. Plucky seems to want to install grub-common each time I run apt dist-upgrade . . . I have tried to lock grub, and then I remove it, so how can I “lock it out” . . . seems like a catch-22, can’t keep it from being installed, to then lock it.

After I upgraded 378 packages this morning I removed again grub-common, and then took a look at /etc/default/grub . . . but it doesn’t seem to show anything about “enable osprober=true” or anything that I could edit there . . . ???

It did seem like a few years back ubuntu decided that it should be the grub handler OS and then that would futz with the other OSs . . . so I removed grub. Now the OS seems to want it installed, any way to block that? OR, each time I run apt I will install it and then have to remove it, over and over???

1 Like

#GRUB_DISABLE_OS_PROBER=false
Look for DISABLE rather than enable
Somewhere around line 18?

2 Likes

Thanks for the reply . . . pretty sure that line was not there, might be because I had removed grub?? the file is /etc/default/grub correct??

Possibly I might have to reinstall grub, then look for that line and then uncomment it and change it to “true”???

Yes, that is the file /etc/default/grub

1 Like

OK, thanks for that . . . any thoughts on whether I would need to let apt install grub again and then check that file to see if I could then edit it . . . and then again remove it??

I don’t need or want grub in my plucky install . . . but plucky seems to . . . .

Your OS which controls OS_PROBER, is it set as first boot priority in the UEFI settings?

1 Like

May I add something here?

The command update-grub is a Ubuntu executable shell script that is found /usr/sbin/ It runs a Grub file called grub-mkconfig that actually creates the file that is used to produce the Grub boot menu.

Also in /usr/sbin/ is another Ubuntu executable file called grub-install.

It is my guess that whenever a new Linux kernel is installed then update-grub is run. I am also guessing that when Grub itself is upgraded then grub-install is run putting the Ubuntu Grub in charge of the boot process.

I do not see that as a problem as we are still able to boot into any other OS on the drive. It would be an option in the Grub boot menu.

On the other hand we may not want Ubuntu to be in change of the boot process. Or we may want a different install of Ubuntu to be in charge of the boot process. I would boot into the other install of Ubuntu and run grub-install and point to the EFI System partition of the drive.

How a person using a different distribution of Linux would run the Grub special executable files that would detect other operating systems and then install Grub into the EFI System partition I could not say. I am not familiar with other distributions of Linux. I doubt that they would have Ubuntu’s update-grub and grub-install executable files. They may do things differently.

I offer this as a possible solution. I give no promise that it will work or that there will not be complications. Change the permissions on the grub-install file so that it does not execute.

Regards

1 Like

My 5¢ worh -

I too multi boot 'Buntus; my solution is to disable 30_os-prober in my secondary installs:

sudo chmod -x /etc/grub.d/30_os-prober

update-grub in the secondaries as I go along - propagates the change
and finally in my primary update-grub.
I prefer hands on manual file control over a /etc/default/grub edit; that “could” get over written.

-many paths to an end-

3 Likes

Good question, that might get “complicated” in that all of my 7 linux installs are running on a Mac, and that messes around with the efibootmgr situation such that it isn’t “profitable” to spend time trying to figure that out . . . .

It took me many years to figure out that I needed to create a separate partition for the /boot/efi to install grub into, away from sda1 that OSX uses, and once I did that and installing grub after anything done in OSX . . . gets me a grub drop down menu, handled now by Tumbleweed, in which yes, its os-prober is listed at the top.

I have gotten feedback on the TW forum from other multi-booters who “don’t care” who handles grub, as their various OSs install or upgrade grub that latest grub will take over and it might not “matter” . . . but then I like the Grub menu that TW provides versus the B&W version offered by others . . . .

I appreciate the other feedback, I’ll have to check into it, other stuff going on trying to get a new machine booting an old SSD going on right now.

Most of the other 5 linux installs I ran I did not install the bootloader, and they don’t try to “take over” and install grub, they might offer it as something I could install, but they don’t, as ubuntu does, include it in the apt dist-upgrade . . . as plucky now seems to bne doing each time I run apt. I might try that chmod command, but then rather than just disabling os-prober, I don’t even want grub installed in ubuntu . . . a couple years back in the earlier iterations (my Lubuntu install goes way back) ubuntu wasn’t insisting on adding grub to the system, now it does . . . .

Have you tried holding to keep it from being upgraded?
sudo apt-mark hold grub-common

In theory, this should prevent GRUB from being installed or upgraded when you run dist-upgrade

1 Like

Thanks for the thought, this might work . . . I’ll give it a try in a bit . . . I did “lock” it in synaptic, but then when I removed it after that it didn’t seem to prevent it from showing up again in dist-upgrade . . . .

[edit]: Hmm . . . didn’t exactly pan out, as grub-comman isn’t installed, so it can’t be locked . . . . etc.

sudo apt-mark hold grub-comman
[sudo] password: 
E: Unable to locate package grub-comman
E: No packages found

[/edit]

A little typo error
comman > common

grub-common

O jeez . . . hilariously sad . . . what can I say, old guy, lots going on . . . not paying attention at the console . . . . : - 0

OK, when typed properly this did keep grub from showing up in apt . . . and that is the desired outcome.

2 Likes