Why is there an "update-grub" and a "update-grub2" command? [duplicate]

I updated my linux machine (dist-upgrade) and the linux-headers were updated. Suddenly the Windows option in GRUB was gone (booting parallel). This was solved by issuing "update-grub" everything works fine now.

Question: I have the command update-grub and update-grub2. Whats the difference? If Grub2 is installed, why is there an update-grub command which I presume is grub 1?


Solution 1:

Many years ago, GRUB1 was still a thing. When GRUB2 came along, it needed various commands but because GRUB1 was still the main system in use, there needed to be a way to differentiate the utilities, meaning a load of ...2-style commands were created.

After the transition, people were still using both commands (for the same jobs), therefore to stop people's scripts breaking, they were just linked together. You can see that:

$ file $(which update-grub{,2})
/usr/sbin/update-grub:  POSIX shell script, ASCII text executable
/usr/sbin/update-grub2: symbolic link to `update-grub'

Note that symlinking commands together doesn't always mean something does the same thing (an application can read what command was run) but if you look at the source of update-grub, you can see this isn't the case here. They do exactly the same thing.