When I boot my Ubuntu 20.04 server (virtualbox vdi, local dev), I get the following error:
Error: invalid environment block.
press any key to continue....
Now, when I run updates, everything installs correctly, except for grub, which throws this error:
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.04-1ubuntu26.17); 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.04-1ubuntu26.17); 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.04-1ubuntu26.17); however:
Package grub-common is not configured yet.
grub-pc depends on grub2-common (= 2.04-1ubuntu26.17); however:
Package grub2-common is not configured yet.
grub-pc depends on grub-pc-bin (= 2.04-1ubuntu26.17); 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 the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
Errors were encountered while processing:
grub-common
grub2-common
grub-pc-bin
grub-pc
E: Sub-process /usr/bin/dpkg returned an error code (1)
Solutions I've tried
I booted the server from system disk and ran e2fsck /dev/sda2 -y
as suggested in Error: invalid environment block. Press any key to continue (Ubuntu 20.04 ZFS), but no luck.
Running
sudo dpkg --configure -a && sudo apt --fix-broken install
Running
dpkg --purge --force-depends grub-common && apt-get -f install
Any tips?