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
  • What distro are you running? If it's Ubuntu 14.04 or later you should already be running GRUB2. – Batcastle Apr 27 '18 at 04:17
  • 1
    @Batcastle: that is not true. I have a Xenial system booting off grub-legacy. – leggewie May 19 '20 at 16:09
  • @MAV If you upgraded that system from Precise that wouldn't suprise me. I was talking as in if you installed 14.04 or later it SHOULD be using GRUB2 by default. – Batcastle May 19 '20 at 22:07
  • 1
    It's still not true, as you can deviate from the default. In any case, your original comment is definitely wrong and might mislead coming here, so I pointed out your error. – leggewie May 20 '20 at 18:42

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
  • 239
  • 2
  • 4
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
  • 998
  • 6
  • 9