Last week, following a failure to upgrade a kernel, which forced me to use "grub>" commands to recover, I began receiving the following message every time I used apt.
Here is an example of the full error message:
I immediately tried
but both failed with the same message given above, regardless of how many times I repeated them.
I also tried reinstalling grub-pc, and the kernel, but that didn't resolve the problem either.
I decided to do some dorking and found this solution, which worked nicely.
Remember, once you remove /etc/grub.d directory you can't reboot until you complete the following three commands.
Errors were encountered while processing:
grub-pc
linux-image-5.14.0-1032-oem
grub-pc
linux-image-5.14.0-1032-oem
/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
Processing triggers for linux-image-5.14.0-1032-oem (5.14.0-1032.35) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.14.0-1032-oem
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/99_breeze-grub.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
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.
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-5.14.0-1032-oem (--configure):
installed linux-image-5.14.0-1032-oem package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
grub-pc
linux-image-5.14.0-1032-oem
dpkg: error processing package grub-pc (--configure):
installed grub-pc package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.14.0-1032-oem (5.14.0-1032.35) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.14.0-1032-oem
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/99_breeze-grub.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
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.
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-5.14.0-1032-oem (--configure):
installed linux-image-5.14.0-1032-oem package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
grub-pc
linux-image-5.14.0-1032-oem
sudo dpkg --configure -a
sudo apt install -f
sudo apt install -f
I also tried reinstalling grub-pc, and the kernel, but that didn't resolve the problem either.
I decided to do some dorking and found this solution, which worked nicely.
sudo apt purge grub-pc grub-common
sudo rm -r /etc/grub.d/
sudo apt install grub-pc grub-common
sudo grub-install /dev/sda
sudo update-grub
sudo rm -r /etc/grub.d/
sudo apt install grub-pc grub-common
sudo grub-install /dev/sda
sudo update-grub
Comment