3

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.

Andrea
  • 31

2 Answers2

1

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:

apt remove grub-legacy
apt install grub2 grub-pc
cd /boot/grub ; mv menu.1st  menu.1st.save
grub-install /dev/sda --recheck   # repeat this if you have any mirrored disks
update-grub

Which is basically kind of a manual install of grub.

Tim Bray
  • 249
1

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.

leggewie
  • 1,087