I have an ubuntu 20.04.6 LTS installation. Every time I do any sudo apt-get upgrade
(and other install, configure, update and upgrade actions), I have an error with grub-pc. This also happens with e.g. dpkg --configure -a
.
I have been ignoring this error, but now it prevents me from upgrading to Ubuntu 22 LTS.
The error is always triggered by an unsuccessful command in the post install script for grub-pc. The grub-pc process seems to triggered by the installation / configuration attempt for grub-efi-amd64-signed
. Here is the underlying error:
sed: cannot rename /etc/default/sedzFNXvt: Operation not permitted
where the file name is apparently a random temp file name created by the script. This is followed by
dpkg: error processing package grub-pc (--configure):
installed grub-pc package post-installation script subprocess returned error exit status 4
and then
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
Package grub-efi-amd64 is not installed.
Package grub-pc is not configured yet.
I have tried all kinds of things, including forced reinstall, manually removing packages etc. It always results in this same script error.
Any ideas?
EDIT
The concrete problem is that I cannot upgrade to Ubuntu 22.04.2. After do-release-upgrade
I get
Checking for a new Ubuntu release
Please install all available updates for your release before upgrading.
But sudo apt-get upgrade
leads to the above error.