So i did a mistake of using Grub Customizer and then did another while trying to restore previous config by following instructions in /etc/grub.d/backup/RESTORE_INSTRUCTIONS
, which led to corrupting my grub config files.
Now when i try to run sudo update-grup
i get
Sourcing file `/etc/default/grub'
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.
The resulting grub.cfg.new
is empty (it contains only the initial comment about it being generated).
I have tried to reinstall the grub according to this answer by
sudo apt-get purge grub-pc grub-common
but it no longer works. First the apt
complained about unmet dependencies and when i added grub2-common grub-pc-bin
to the list to be removed, it told me it needs to install these instead
... grub-common:i386 grub-efi-amd64 grub2-common:i386 ...
After some hesitation i accepted it, and let those packages install with the intention to replace them back aftewards, but i ran into this again during installation
Script `/boot/grub/grub.cfg.new' contains no commands and will do nothing
...
dpkg: error processing package grub-pc (--configure):
installed grub-pc package post-installation script subprocess returned error exit status 1
So apparently the update-group
is now part of the post-install script, and if it fails the package fails to install. So now i'm in a state where dependencies are broken in both ways and neither of the grub versions is properly installed and cannot be fixed.
The configuration files of the grub
(/etc/default/grub
and /etc/grub.d/*
) were never removed and overwritten during the purge. And if i delete them manually, they are never installed again.
Is there anything i can do to save my installation of the OS now?