Bug? GRUB problem - Upgraded to 22.04 LTS

Hi!

After upgrading from Ubuntu Mate 20.04 LTS to 22.04 LTS, I am having problems with GRUB.

How can I fix that?

Error message in Mate-Terminal:

sudo apt reinstall grub-pc

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
grub-gfxpayload-lists
The following NEW packages will be installed:
grub-gfxpayload-lists grub-pc
0 upgraded, 2 newly installed, 0 to remove and 5 not upgraded.
Need to get 0 B/135 kB of archives.
After this operation, 623 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package grub-pc.
(Reading database ... 186416 files and directories currently installed.)
Preparing to unpack .../grub-pc_2.06-2ubuntu7_amd64.deb ...
Unpacking grub-pc (2.06-2ubuntu7) ...
Selecting previously unselected package grub-gfxpayload-lists.
Preparing to unpack .../grub-gfxpayload-lists_0.7_amd64.deb ...
Unpacking grub-gfxpayload-lists (0.7) ...
Setting up grub-pc (2.06-2ubuntu7) ...

Creating config file /etc/default/grub with new version
Installing for i386-pc platform.
Installation finished. No error reported.
Sourcing file /etc/default/grub' Generating grub configuration file ... **> Script /boot/grub/grub.cfg.new' contains no commands and will do nothing**
> Syntax errors are detected in generated GRUB config file.
> Ensure that there are no errors in /etc/default/grub
> and /etc/grub.d/ files or please file a bug report with*
> /boot/grub/grub.cfg.new file attached.
> dpkg: error processing package grub-pc (--configure):
> installed grub-pc package post-installation script subprocess returned error exit status 1
> dpkg: dependency problems prevent configuration of grub-gfxpayload-lists:
> grub-gfxpayload-lists depends on grub-pc (>= 1.99~20101210-1ubuntu2); however:
> Package grub-pc is not configured yet.
**> **
> dpkg: error processing package grub-gfxpayload-lists (--configure):
> dependency problems - leaving unconfigured
> Processing triggers for man-db (2.10.2-1) ...
> Errors were encountered while processing:
> grub-pc
> grub-gfxpayload-lists
> E: Sub-process /usr/bin/dpkg returned an error code (1)

With LTS 20.04 I had no problems with GRUB so far.

Please help, thanks!

Maybe try sudo update-grub. Maybe that might fix the issue.

I did. :confused:

sudo update-grub

Sourcing file /etc/default/grub' Generating grub configuration file ... Script /boot/grub/grub.cfg.new' contains no commands and will do nothing
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.

Why? grub.cfg.new

I want use my old grub.cfg.

Is there a workaround to disable the UPDATE GRUB scripts?

I always manually edit my "grub.cfg" when
I do a KERNEL UPGRADE.

Has always worked so far.

With 22.04 LTS not.

sudo dpkg-reconfigure grub-pc

/usr/sbin/dpkg-reconfigure: grub-pc is broken or not fully installed

:-/

Download the mate 22.04 live iso, flash it to a usb drive and boot from it. One it's booted and you connect it to the internet, run in a terminal:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt update
sudo apt install boot-repair
Then launch the app and follow the instructions.

sudo dpkg -i grub-pc_2.06-2ubuntu7_amd64.deb

Preparing to unpack grub-pc_2.06-2ubuntu7_amd64.deb ...
Unpacking grub-pc (2.06-2ubuntu7) over (2.06-2ubuntu7) ...
dpkg: dependency problems prevent configuration of grub-pc:
grub-pc depends on grub-gfxpayload-lists; however:
Package grub-gfxpayload-lists is not configured yet.

dpkg: error processing package grub-pc (--install):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
grub-pc

Preparing to unpack grub-gfxpayload-lists_0.7_amd64.deb ...
Unpacking grub-gfxpayload-lists (0.7) over (0.7) ...
dpkg: dependency problems prevent configuration of grub-gfxpayload-lists:
grub-gfxpayload-lists depends on grub-pc (>= 1.99~20101210-1ubuntu2); however:
Package grub-pc is not configured yet.

dpkg: error processing package grub-gfxpayload-lists (--install):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.10.2-1) ...
Errors were encountered while processing:
grub-gfxpayload-lists

Depency problem?

sudo update-grub

Sourcing file /etc/default/grub' Generating grub configuration file ... Script /boot/grub/grub.cfg.new' contains no commands and will do nothing
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.

Did you try my suggestion above? Try accessing another pc that you know to create the flash drive.

@ Basil_Cat, not yet :wink:

Workaround, I did:

sudo apt purge --remove grub-pc grub-pc-bin grub-gfxpayload-lists os-prober

Recovered my grub.cfg:

/boot/grub/grub.cfg

Installed GRUB packages:
grub-common
grub2-common

Rebooted.

My system is booting into 22.04 LTS.

GRUB-error is gone.

By the way...
I don't like the automatic GRUB kernel update.

I edit all entries in my grub.cfg even when a kernel upgrade is imminent.

and only use "update-initramfs".

Anyway, thanks for your intentional help @ Basil_Cat.