The update-grub
script in Ubuntu is actually just a stub for grub-mkconfig
, and it can be adapted to other distros without too much pain. Here it is in its entirety:
#!/bin/shset -eexec grub-mkconfig -o /boot/grub/grub.cfg "$@"
This effectively does what is recommended in the CentOS wiki, and in other answers here - the only difference is that you need to change grub
to grub2
in the command and the output path.
(Note that the path will be different for UEFI-based systems - see the wiki link)