I'm trying to upgrade my bootloader from GRUB to GRUB2 following this guide
https://help.ubuntu.com/community/Grub2/Upgrading
Problem is that at the end of the process when i do
sudo upgrade-from-grub-legacy
It will appear an error message and it will stop
dpkg-maintscript-helper: error: environment variable DPKG_MAINTSCRIPT_NAME is required
System is a cloud based service (QuadraNet) where they provide VPS with ubuntu 16.04x64bit preloaded. At the moment both Grub-legacy and Grub2 are present, but only Grub-legacy is loading.
I had the same message on debian. I couldn't get the message to leave.
(Beware that if something goes wrong, you could have a system that won't boot. Maybe download a live USB stick. )
under root / sudo -i run:
Which is basically kind of a manual install of grub.
This is a bit of an old problem, but it was only fairly recently fixed in Debian. All current Ubuntu LTS as well as Ubuntu+1 impish are still affected. A very simple and maintainer-approved patch is available.