We are updating packages via Ansible, and when grub needs to be run after the update, it fails on Debian 11. When I run the update command manually, grub displays a dialog box asking the user to select the grub install device (/dev/vda, /dev/vda2, /dev/vda3, etc.).
We have our playbook running with an environment variable DEBIAN_FRONTEND: noninteractive.
That’s what we started to look at, but the issue becomes during a general package update, you don’t always know if grub will need to be updated. I’m not even sure how you’d tell this in an apt-get update.
Sounds like you’ll need to apt-mark hold grub first, and handle updates to grub separately from the others.
Also sounds like a bug in the grub package.
If we do an apt-mark hold grub first, we are left with the dilemma of how to update grub without presenting a dialog. This is only happening on Debian 11 boxes. We have tried using the :
1, Is it ALL Debian 11 machines or just one/a few?
2. How was(/were) the VM(s) installed/created? If you create a new, clean VM, and just do a grub-update do you have the same problem?
3. Try reviewing and feeding back on the questions/advice on either or both of SO and the Debian forum.
Try spinning up an AWS Debian 11 instance and compare/contrast to your broken instance(s). This is one I’ve just spun up moments ago:
root@ip-172-31-31-103:~# ls -l /etc/grub.d/
total 84
-rwxr-xr-x 1 root root 10046 Nov 8 17:29 00_header
-rwxr-xr-x 1 root root 6260 Nov 8 17:29 05_debian_theme
-rwxr-xr-x 1 root root 14123 Nov 8 17:29 10_linux
-rwxr-xr-x 1 root root 14180 Nov 8 17:29 20_linux_xen
-rwxr-xr-x 1 root root 12910 Nov 8 17:29 30_os-prober
-rwxr-xr-x 1 root root 1372 Nov 8 17:29 30_uefi-firmware
-rwxr-xr-x 1 root root 214 Nov 8 17:29 40_custom
-rwxr-xr-x 1 root root 215 Nov 8 17:29 41_custom
-rw-r–r-- 1 root root 483 Nov 8 17:29 README
-rw-r–r-- 1 root root 0 Jan 24 04:24 enable_cloud
root@ip-172-31-31-103:~# ls -l /etc/default/grub.d/
total 8
-rw-r–r-- 1 root root 15 Jan 24 04:27 15_timeout.cfg
-rw-r–r-- 1 root root 274 Aug 3 2022 init-select.cfg
root@ip-172-31-31-103:~# update-grub
Generating grub configuration file …
Found linux image: /boot/vmlinuz-5.10.0-21-cloud-amd64
Found initrd image: /boot/initrd.img-5.10.0-21-cloud-amd64
done
Something’s borked your grub build config, you need to find and fix that.