can't update grub-common under ubuntu 22.04 LTS

Asked by Jacques Lerin

Hello there!

I run into a permanent problem when the system tries to update grub-common and of course grub2-common.
It seems to be a dependancy problem.

generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-58-generic
Found initrd image: /boot/initrd.img-5.15.0-58-generic
Found linux image: /boot/vmlinuz-5.15.0-57-generic
Found initrd image: /boot/initrd.img-5.15.0-57-generic
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
Suppression de linux-modules-5.15.0-56-generic (5.15.0-56.62) .................................................................................
Paramétrage de grub-common (2.06-2ubuntu7.1) ...
Could not execute systemctl: at /usr/bin/deb-systemd-invoke line 142.
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Job for grub-common.service failed because the control process exited with error code.
See "systemctl status grub-common.service" and "journalctl -xeu grub-common.service" for details.
invoke-rc.d: initscript grub-common, action "restart" failed.
× grub-common.service - Record successful boot for GRUB
     Loaded: loaded (/lib/systemd/system/grub-common.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2023-01-13 09:17:08 CET; 18ms ago
    Process: 35511 ExecStartPre=/bin/sh -c [ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv; mkdir -p /boot/grub (code=exited, status=0/SU
CCESS)
    Process: 35513 ExecStart=grub-editenv /boot/grub/grubenv unset recordfail (code=exited, status=1/FAILURE)
   Main PID: 35513 (code=exited, status=1/FAILURE)
        CPU: 14ms

janv. 13 09:17:08 lerin-Inspiron-15-3552 systemd[1]: Starting Record successful boot for GRUB...
janv. 13 09:17:08 lerin-Inspiron-15-3552 grub-editenv[35513]: grub-editenv : erreur : bloc d'environnement incorrect.
janv. 13 09:17:08 lerin-Inspiron-15-3552 systemd[1]: grub-common.service: Main process exited, code=exited, status=1/FAILURE
janv. 13 09:17:08 lerin-Inspiron-15-3552 systemd[1]: grub-common.service: Failed with result 'exit-code'.
janv. 13 09:17:08 lerin-Inspiron-15-3552 systemd[1]: Failed to start Record successful boot for GRUB.
dpkg: erreur de traitement du paquet grub-common (--configure) :
 installed grub-common package post-installation script subprocess returned error exit status 1
dpkg: des problèmes de dépendances empêchent la configuration de grub2-common :
 grub2-common dépend de grub-common (= 2.06-2ubuntu7.1) ; cependant :
 Le paquet grub-common n'est pas encore configuré.

dpkg: erreur de traitement du paquet grub2-common (--configure) :
 problèmes de dépendances - laissé non configuré
Aucun rapport « apport » n'a été créé car le message d'erreur indique une erreur consécutive à un échec précédent.
                                                                                                                  Des erreurs ont été rencontré
es pendant l'exécution :
 grub-common
 grub2-common

Thank you in advance if you can help me correct this problem

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Jacques Lerin
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

For diagnostic purposes please provide the output that you receive for the following commands (to be executed in a terminal window):

uname -a
lsb_release -crid
apt policy grub-common grub2-common
ls -l /boot/grub/grubenv
cat /boot/grub/grubenv

Revision history for this message
Jacques Lerin (jackcrack) said :
#2

Hello Manfred, here are the answers to your questions

lsb_release -cridDistributor ID:    Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:    22.04
Codename:    jammy
lerin@lerin-Inspiron-15-3552:~

pt policy grub-common grub2-common
grub-common:
   Installé : 2.06-2ubuntu7.1
   Candidat : 2.06-2ubuntu7.1
  Table de version :
  *** 2.06-2ubuntu7.1 500 (phased 40%)
         500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64
Packages
         100 /var/lib/dpkg/status
      2.06-2ubuntu7 500
         500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
grub2-common:
   Installé : 2.06-2ubuntu7.1
   Candidat : 2.06-2ubuntu7.1
  Table de version :
  *** 2.06-2ubuntu7.1 500 (phased 40%)
         500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64
Packages
         100 /var/lib/dpkg/status
      2.06-2ubuntu7 500
         500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages

ls -l /boot/grub/grubenv
-rw-r--r-- 1 root root 1024 oct.  23 14:10 /boot/grub/grubenv

cat /boot/grub/grubenv

no answer!

Le 13/01/2023 à 09:55, Manfred Hampl a écrit :
> Your question #704382 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/704382
>
> Status: Open => Needs information
>
> Manfred Hampl requested more information:
> For diagnostic purposes please provide the output that you receive for
> the following commands (to be executed in a terminal window):
>
> uname -a
> lsb_release -crid
> apt policy grub-common grub2-common
> ls -l /boot/grub/grubenv
> cat /boot/grub/grubenv
>
--
Jack Pop's Papounet

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

What output do you receive for the following commands:

sudo rm -f /boot/grub/grubenv
sudo grub-editenv /boot/grub/grubenv create
cat /boot/grub/grubenv
sudo dpkg --configure -a

Revision history for this message
Jacques Lerin (jackcrack) said :
#4

Hi Manfred, here is the results of your commands

erin@lerin-Inspiron-15-3552:~$ sudo rm -f /boot/grub/grubenv
[sudo] Mot de passe de lerin :
lerin@lerin-Inspiron-15-3552:~$ sudo grub-editenv /boot/grub/grubenv create
lerin@lerin-Inspiron-15-3552:~$ cat /boot/grub/grubenv
# GRUB Environment Block
# WARNING: Do not edit this file by tools other than grub-editenv!!!
##################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################lerin@lerin-Inspiron-15-3552:~$
sudo dpkg --configure -a
Paramétrage de grub-common (2.06-2ubuntu7.1) ...
update-rc.d: warning: start and stop actions are no longer supported;
falling back to defaults
Paramétrage de grub2-common (2.06-2ubuntu7.1) ...
lerin@lerin-Inspiron-15-3552:~$

I'm going to check the result.

Le 13/01/2023 à 13:35, Manfred Hampl a écrit :
> Your question #704382 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/704382
>
> Status: Open => Needs information
>
> Manfred Hampl requested more information:
> What output do you receive for the following commands:
>
> sudo rm -f /boot/grub/grubenv
> sudo grub-editenv /boot/grub/grubenv create
> cat /boot/grub/grubenv
> sudo dpkg --configure -a
>
--
Jack Pop's Papounet

Revision history for this message
Jacques Lerin (jackcrack) said :
#5

It seems to work now.
I don't have any error message when I run 'sudo apt update && sudo apt upgrade'.

Thank you very much for your help.