Any way to keep "grub" out of apt updates??

Kernels & Hardware, configuring network, installing services

Any way to keep "grub" out of apt updates??

Postby este.el.paz » 2020-12-24 17:00

Folks:

Been running a Bullseye edition now for a few months with XFCE . . . overall it's a great distro . . . but, for the last year I've had problems with grub updates in the Debian/ubuntu world where my multi-boot links in grub are wiped clean and I have to get the SuperGrub2 disk out, figure out which line item boots the TW install and then run their version of grub update . . . . It happened so many times in the Spring that I stopped updating grub in the "ubuntu" realm, and then I changed one of them to Debian . . . .

In Debian I was using synaptic to run upgrades, but that also was involving the line item marking to select the updates to run, and then there were the hundereds of language packages, for which my universe is one, but that seemed to work, and I thought I "pinned" a number of the grub packages . . . they now have the "red" flag on the item in synaptic.

I ran apt this morning and in the "343" packages to upgrade listed was a few "grub" items . . . I went to synaptic and selected "installed upgradable" and then "mark upgrades" and the list (which didn't show any grub items) turned yellow. I scrolled through the list to double check, no grub . . . I clicked "apply changes" and the small "confirmation box" opened . . . I clicked on the down arrow and scrolled down . . . and buried in that list were four or so "grub" updates?????

Went back to the original "marked" list . . . no grub. Clicked on "pinned" and it shows the 4 or more "grub" packages flagged as red??

Any way to keep "grub" from showing up in the list, or since I have working grub updates in my two OpenSUSE and one Manjaro install, can I "remove" grub from the Debian install without causing issue to the boot capacity of Debian???
este.el.paz
 
Posts: 42
Joined: 2012-03-09 19:56
Location: SoCal

Re: Any way to keep "grub" out of apt updates??

Postby Head_on_a_Stick » 2020-12-24 18:04

este.el.paz wrote:my multi-boot links in grub

What does this mean, exactly?

If you are editing /boot/grub/grub.cfg directly then stop doing that and add your "links" to either /boot/grub/custom.cfg or /etc/grub.d/40_custom instead (stanzas in the latter file will be added after the update-grub command has been run).

Other distributions should be picked up and added to grub.cfg automatically by the os-prober package anyway, does that not work for you?

EDIT: I don't think Debian's GRUB can handle Arch-based systems in which the CPU microcode packages have been installed, the multiple initramfs images break the configuration. See https://wiki.archlinux.org/index.php/GRUB#GNU/Linux for some suggestions as to how to add menuentry stanzas.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13062
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Any way to keep "grub" out of apt updates??

Postby este.el.paz » 2020-12-24 18:36

Head_on_a_Stick wrote:
este.el.paz wrote:my multi-boot links in grub

What does this mean, exactly?

If you are editing /boot/grub/grub.cfg directly then stop doing that and add your "links" to either /boot/grub/custom.cfg or /etc/grub.d/40_custom instead (stanzas in the latter file will be added after the update-grub command has been run).

Other distributions should be picked up and added to grub.cfg automatically by the os-prober package anyway, does that not work for you?


Thanks for the reply . . . I usually don't mess with too much "under the hood" because just running a bunch of linux installs is enough to take up the time . . . .

Posting the link to the most active bug report to give you the background on the problem, but short version, for sure "ubuntu" updates to grub were "wiping the grub menu" so that the only options were to single boot into . . . ubuntu, all the other distros were "intact" but not bootable. Not sure if I confirmed the problem in Debian, but it's been an issue for almost a year.

https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1863434
este.el.paz
 
Posts: 42
Joined: 2012-03-09 19:56
Location: SoCal

Re: Any way to keep "grub" out of apt updates??

Postby Head_on_a_Stick » 2020-12-24 18:44

Are you editing /boot/grub/grub.cfg directly?
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13062
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Any way to keep "grub" out of apt updates??

Postby kedaha » 2020-12-24 20:07

Hi,
While looking for a satisfactory solution you can hold the grub packages by using the apt-mark command.
As the man page says:
PREVENT CHANGES FOR A PACKAGE
hold
hold is used to mark a package as held back, which will prevent the package from being automatically installed, upgraded or removed.

unhold
unhold is used to cancel a previously set hold on a package to allow all actions again.

showhold
showhold is used to print a list of packages on hold in the same way as for the other show commands.

For example, on my desktop system I have five grub packages so if I wanted to set them on hold I would open a terminal and, as root, do this:
Code: Select all
# apt-mark hold grub-common grub-pc-bin grub-pc grub2-common grub-customizer

resulting in:
Code: Select all
grub-common set on hold.
grub-pc-bin set on hold.
grub-pc set on hold.
grub2-common set on hold.
grub-customizer set on hold.

And if I wished to undo the above command:
Code: Select all
# apt-mark unhold grub-common grub-pc-bin grub-pc grub2-common grub-customizer
Canceled hold on grub-common.
Canceled hold on grub-pc-bin.
Canceled hold on grub-pc.
Canceled hold on grub2-common.
Canceled hold on grub-customizer.
"Please accept my resignation. I don’t care to belong to any club that will have me as a member".—Groucho Marx
User avatar
kedaha
 
Posts: 3157
Joined: 2008-05-24 12:26

Re: Any way to keep "grub" out of apt updates??

Postby este.el.paz » 2020-12-24 20:11

Head_on_a_Stick wrote:Are you editing /boot/grub/grub.cfg directly?


As mentioned . . . I'm not editing anything . . . I checked what was it ? etc/default/grub ?? but I haven't made any changes to that file . . . .

@kedaha:

Ah, OK, thanks for those commands . . . I'll check that out when I get back to my Debian install . . .
este.el.paz
 
Posts: 42
Joined: 2012-03-09 19:56
Location: SoCal

Re: Any way to keep "grub" out of apt updates??

Postby Head_on_a_Stick » 2020-12-24 20:36

este.el.paz wrote:Posting the link to the most active bug report to give you the background on the problem

That bug report describes a completely different problem. You say that your multi-boot entries are removed after an update leaving you with just the Debian entry but the bug report you have attempted to hijack clearly states that no menu is seen at all. FWIW the Ubuntu developers say that this is a feature rather than a bug and the menu will be seen if the escape key is pressed.

Anyway, please post the full output of
Code: Select all
/usr/sbin/grub-mkconfig

Be sure to use code tags for the output, it will be rather lengthy.

As I mentioned earlier you can add stanzas to /boot/grub/custom.cfg for your other distributions, that should be sourced by grub.cfg and maintain the menuentries even if grub-mkconfig fails. Holding the GRUB packages back is a workaround rather than a solution and may leave you exposed to any future bugs and vulnerabilities.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13062
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Any way to keep "grub" out of apt updates??

Postby kedaha » 2020-12-24 20:44

I have re-read your original post. My advice would be to only use the Debian grub and remove all the other grub bootloaders from the other distros. But someone else will be able to advise you about that since I don't multiboot other linux distros. Even better would be to get rid of the lot and use only Debian. :mrgreen:
"Please accept my resignation. I don’t care to belong to any club that will have me as a member".—Groucho Marx
User avatar
kedaha
 
Posts: 3157
Joined: 2008-05-24 12:26

Re: Any way to keep "grub" out of apt updates??

Postby este.el.paz » 2020-12-24 21:57

@Head_on_a:

Alrighty, thanks again for the follow-up . . . not sure why you added the "you tried to hijack that thread" comment to your post . . . .??? The grub problem with multi-boot set-ups over the last year has indeed gone well beyond "menu not visible" but that thread has the largest number of people who were posting about problems with grub . . . including me--that's why I posted it here. Unlike many bug reports on launchpad that have one or two people having the issue, that bug has something like 40 people, possibly more--that is in the linux world a huuugggeee number of complainers to a problem. The dev claiming that was "a feature" clearly didn't understand why anybody would want to boot anything other than ubuntu.

I'm posting on this forum because in my other two "debian" based ubuntu systems I can use synaptic to update everything but grub, but in debian it seems to be confounding those efforts and kedaha has now provided the apt-mark commands to try out . . . I boot a different linux OS every day, today was Debian day, but now I'm away from that machine and Debian has been put away. When I get back to it I'll take a look at your suggestions and will post back on it.

@kedaha:

Thanks for your civil posts . . . indeed, there aren't a lot of people who do multi-boot, so the data out there is sparse and subject to loads of hot air . . . . I started doing that because I was running macs, so the advice back then was "dual-boot" with OSX . . . and I just kept adding distros. For the most part I am liking this flavor of Debian more than the Debian in the more distant past, it is a keeper, but the "400 language packs" was a tad excessive, and having to do line item updates in synaptic was problematic . . . I'll try out your apt-mark suggestions and see how that works out.
este.el.paz
 
Posts: 42
Joined: 2012-03-09 19:56
Location: SoCal

Re: Any way to keep "grub" out of apt updates??

Postby Head_on_a_Stick » 2020-12-24 22:13

este.el.paz wrote:not sure why you added the "you tried to hijack that thread" comment to your post . . . .?

Because the problem that you describe is *not* the problem described in the initial bug report, ergo you have attempted to hijack the bug report with your completely unrelated problem.

But perhaps I have misunderstood the situation so please clarify for me: do you or do you not see any sort of GRUB menu when you boot the machine?

It would be tremendously helpful if you just describe exactly what you see when you boot the machine, preferably without the addition of multiple superfluous punctuation marks.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13062
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Any way to keep "grub" out of apt updates??

Postby CwF » 2020-12-24 22:30

When multiple OS's share grub you should pick one to control grub. Uninstall grub in the others. If the question is how to hold back debians' grub, maybe uninstall it, done.
CwF
 
Posts: 881
Joined: 2018-06-20 15:16

Re: Any way to keep "grub" out of apt updates??

Postby Head_on_a_Stick » 2020-12-25 08:17

CwF wrote:uninstall it

The grub-mkconfig script creates a menuentry that points to a specific kernel version so any new kernel versions will not be given a menuentry and the OP would be stuck with an outdated kernel.

If there is a problem with grub-mkconfig then we need to pin it down and report it as a bug so that it can be fixed, anything else is a counter-productive workaround.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13062
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Any way to keep "grub" out of apt updates??

Postby este.el.paz » 2020-12-25 15:30

Head_on_a_Stick wrote:
CwF wrote:uninstall it

The grub-mkconfig script creates a menuentry that points to a specific kernel version so any new kernel versions will not be given a menuentry and the OP would be stuck with an outdated kernel.

If there is a problem with grub-mkconfig then we need to pin it down and report it as a bug so that it can be fixed, anything else is a counter-productive workaround.


@Head_on_a_Stick:

Interesting point, there have been issues with my Lubuntu 20.10 install that is still running a 5.4 kernel, which I think goes back to "focal" . . . system upgraded by editing sources.list, but otherwise box stock. It has only been a few months that I haven't upgraded grub in these systems, perhaps June??

I'll post back on your request when I get a moment on it . . . actually, today is "Lubuntu" day, and that system has had issues, might be interesting to compare your suggested commands on the "mkconfig" files from both of them . . . . I'll post it when I gets it, etc . . . makes sense to check it out, before removing it.

CwF wrote:When multiple OS's share grub you should pick one to control grub. Uninstall grub in the others. If the question is how to hold back debians' grub, maybe uninstall it, done.


@CwF:

Appreciate the thoughts, did spend some time with some knowledgeable folks on the OpenSUSE forum about this some months back, possibly one of the guys suggested that since I was multi-booting I wouldn't have to install the bootloader . . . ??? It's possible that I tried that out; in my case now it seems like OpenSUSE is "in charge of grub menu" . . . it is the system whose os-prober will rebuild grub properly, unfortunately "update-grub" in the ubuntu flavors isn't sufficient to do that.

Merriest of Christmas' to all, etc. :D
este.el.paz
 
Posts: 42
Joined: 2012-03-09 19:56
Location: SoCal

Re: Any way to keep "grub" out of apt updates??

Postby p.H » 2020-12-25 19:27

Head_on_a_Stick wrote:The grub-mkconfig script creates a menuentry that points to a specific kernel version so any new kernel versions will not be given a menuentry and the OP would be stuck with an outdated kernel.

Until the old kernel is eventually removed and no menu entry matches any installed kernel anymore, leaving the system unbootable.

Short reminder of how grub-mkconfig adds menu entries for another system discovered by os-prober :

- If it finds a grub.cfg file in that system, it uses its uses information in its menu entries (kernel parameters, initramfs) to generate menu entries for existing kernels. Menu entries for non-existing kernels are ignored, and so are existing kernels without menu entries.

- If it does not find a grub.cfg file, it generates menu entries for existing kernels using the root block device file such as /dev/sdXY or /dev/dm-N as the root= parameter instead of the UUID or expected LVM alias, which is often wrong as block device names are not stable.

So you really want all secondary systems to have an up-to-date grub.cfg file so that grub-mkconfig generates proper entries for them in the main GRUB menu. You do not need to have a full GRUB installed for this. In Debian, you just need to have update-grub and kernel hook scripts present, i.e. the grub2-common package installed.
p.H
 
Posts: 1620
Joined: 2017-09-17 07:12

Re: Any way to keep "grub" out of apt updates??

Postby este.el.paz » 2020-12-25 20:59

@p.H && Head_on_a:

Thanks for the follow-up . . . well, when I have to get the SuperGrub2 disk out to boot the linux systems after the grub menu gets wiped, the list of kernels and vmlinux?? and cfgs is quite lengthy . . . doesn't seem to be self-cleaning . . . takes awhile to figure out which one gets me into the OpenSUSE os-prober to get the working grub menu back, etc.

I did run the requested grub-mkconfig command in Lubuntu . . . also quite lengthy . . . . I'll prolly get back to Debian tomorrow, so I can keep it "in house" to this forum before posting it . . . prolly do tar.gz since it's a bit beyond "code" level??? 6 linux distros and it shows a couple of the OSX options as well.
este.el.paz
 
Posts: 42
Joined: 2012-03-09 19:56
Location: SoCal

Next

Return to System configuration

Who is online

Users browsing this forum: cyberoptiq and 21 guests

fashionable