apt, dpkg: dependency problems prevent configuration of grub-pc
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
#sudo apt update output:
Hit:1 https:/
Hit:2 http://
Hit:3 http://
Hit:4 http://
Hit:5 http://
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
7 packages can be upgraded. Run 'apt list --upgradable' to see them.
# sudo apt list --upgradable output:
Listing... Done
fwupd-signed/
fwupd/jammy-updates 1.7.9-1~22.04.3 amd64 [upgradable from: 1.7.9-1~22.04.1]
gnome-shell-
google-
libfwupd2/
libfwupdplugin5
ubuntu-
#sudo apt upgrade -y output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
Get more security updates through Ubuntu Pro with 'esm-apps' enabled:
imagemagick libopenexr25 libpostproc55 libmagickcore-
libavcodec58 libmagickwand-
libmagickcore
libavfilter7
Learn more about Ubuntu Pro at https:/
The following packages have been kept back:
gnome-
The following packages will be upgraded:
fwupd fwupd-signed google-
5 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
4 not fully installed or removed.
Need to get 97.2 MB of archives.
After this operation, 7,070 kB of additional disk space will be used.
Get:1 https:/
Get:2 http://
Get:3 http://
Get:4 http://
Get:5 http://
Fetched 97.2 MB in 16s (6,117 kB/s)
(Reading database ... 203257 files and directories currently installed.)
Preparing to unpack .../google-
Unpacking google-
Preparing to unpack .../fwupd_
Unpacking fwupd (1.7.9-1~22.04.3) over (1.7.9-1~22.04.1) ...
Preparing to unpack .../libfwupdplu
Unpacking libfwupdplugin5
Preparing to unpack .../libfwupd2_
Unpacking libfwupd2:amd64 (1.7.9-1~22.04.3) over (1.7.9-1~22.04.1) ...
Preparing to unpack .../fwupd-
Unpacking fwupd-signed (1.51.1~
buntu0.2) ...
Setting up google-
Setting up libfwupd2:amd64 (1.7.9-1~22.04.3) ...
Setting up fwupd-signed (1.51.1~
Setting up grub-common (2.06-2ubuntu7.2) ...
Could not execute systemctl: at /usr/bin/
update-rc.d: warning: start and stop actions are no longer supported; falling ba
ck to defaults
Job for grub-common.service failed because the control process exited with error
code.
See "systemctl status grub-common.
ice" for details.
invoke-rc.d: initscript grub-common, action "restart" failed.
× grub-common.service - Record successful boot for GRUB
Loaded: loaded (/lib/systemd/
eset: enabled)
Active: failed (Result: exit-code) since Wed 2023-06-14 12:43:46 IST; 11ms
ago
Process: 5081 ExecStartPre=
ot/grub/grubenv; mkdir -p /boot/grub (code=exited, status=0/SUCCESS)
Process: 5086 ExecStart=
de=exited, status=1/FAILURE)
Main PID: 5086 (code=exited, status=1/FAILURE)
CPU: 8ms
Jun 14 12:43:46 c1 systemd[1]: Starting Record successful boot for GRUB...
Jun 14 12:43:46 c1 grub-editenv[5086]: grub-editenv: error: invalid environment
block.
Jun 14 12:43:46 c1 systemd[1]: grub-common.
ited, status=1/FAILURE
Jun 14 12:43:46 c1 systemd[1]: grub-common.
e'.
Jun 14 12:43:46 c1 systemd[1]: Failed to start Record successful boot for GRUB.
dpkg: error processing package grub-common (--configure):
installed grub-common package post-installation script subprocess returned erro
r exit status 1
Setting up libfwupdplugin5
Setting up fwupd (1.7.9-1~22.04.3) ...
fwupd-offline-
rting it.
fwupd-refresh.
t.
fwupd.service is a disabled or a static unit not running, not starting it.
dpkg: dependency problems prevent configuration of grub2-common:
grub2-common depends on grub-common (= 2.06-2ubuntu7.2); however:
Package grub-common is not configured yet.
dpkg: error processing package grub2-common (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of grub-pc-bin:
grub-pc-bin depends on grub-common (= 2.06-2ubuntu7.2); however:
Package grub-common is not configured yet.
No apport report written because the error message indicates its a followup erro
r from a previous failure.
icates its a followup error from a previous failure.
ge grub-pc-bin (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of grub-pc:
grub-pc depends on grub-common (= 2.06-2ubuntu7.2); however:
Package grub-common is not configured yet.
grub-pc depends on grub2-common (= 2.06-2ubuntu7.2); however:
Package grub2-common is not configured yet.
grub-pc depends on grub-pc-bin (= 2.06-2ubuntu7.2); however:
Package grub-pc-bin is not configured yet.
dpkg: error processing package grub-pc (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
s for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for dbus (1.12.20-
Errors were encountered while processing:
grub-common
grub2-common
grub-pc-bin
grub-pc
# sudo dpkg --configure -a output
Setting up grub-common (2.06-2ubuntu7.2) ...
Could not execute systemctl: at /usr/bin/
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.
invoke-rc.d: initscript grub-common, action "restart" failed.
× grub-common.service - Record successful boot for GRUB
Loaded: loaded (/lib/systemd/
Active: failed (Result: exit-code) since Wed 2023-06-14 12:48:19 IST; 10ms ago
Process: 7912 ExecStartPre=
Process: 7914 ExecStart=
Main PID: 7914 (code=exited, status=1/FAILURE)
CPU: 7ms
Jun 14 12:48:19 c1 systemd[1]: Starting Record successful boot for GRUB...
Jun 14 12:48:19 c1 grub-editenv[7914]: grub-editenv: error: invalid environment block.
Jun 14 12:48:19 c1 systemd[1]: grub-common.
Jun 14 12:48:19 c1 systemd[1]: grub-common.
Jun 14 12:48:19 c1 systemd[1]: Failed to start Record successful boot for GRUB.
dpkg: error processing package grub-common (--configure):
installed grub-common package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of grub2-common:
grub2-common depends on grub-common (= 2.06-2ubuntu7.2); however:
Package grub-common is not configured yet.
dpkg: error processing package grub2-common (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of grub-pc-bin:
grub-pc-bin depends on grub-common (= 2.06-2ubuntu7.2); however:
Package grub-common is not configured yet.
dpkg: error processing package grub-pc-bin (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of grub-pc:
grub-pc depends on grub-common (= 2.06-2ubuntu7.2); however:
Package grub-common is not configured yet.
grub-pc depends on grub2-common (= 2.06-2ubuntu7.2); however:
Package grub2-common is not configured yet.
grub-pc depends on grub-pc-bin (= 2.06-2ubuntu7.2); however:
Package grub-pc-bin is not configured yet.
dpkg: error processing package grub-pc (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
grub-common
grub2-common
grub-pc-bin
grub-pc
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: apt 2.4.9
ProcVersionSign
Uname: Linux 5.19.0-43-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.5
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Wed Jun 14 12:52:26 2023
InstallationDate: Installed on 2023-05-04 (41 days ago)
InstallationMedia: Ubuntu 22.04.2 LTS "Jammy Jellyfish" - Release amd64 (20230223)
ProcEnviron:
LANGUAGE=en_IN:en
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_IN
SHELL=/bin/bash
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)
As you can see in the output grub-common failed to install because the service failed to restart which edits the /boot/grub/grubenv file. This indicates the file is corrupted either due to a bug in grub we don't know about, a hard reset during grub running which corrupted the disk cache or something like that, or the drive is failing.
My suggestion is to perform a drive check and delete the file to solve the issue.