Firstly, and most importantly, executing grub-install requires super-user
privileges. Rather than adding it to PATH you should instead run the command
through sudo. A regular user typically does not need any of sbin
directories in their PATH.
As for the command itself, there are three things wrong with it:
PATHshould only include directories whereas you tried to add to it a path to an executable. So rather than/usr/sbin/grub-install/grub-installyou should just add/usr/sbin.- White space is significant, so the space before colon would make your command not work anyway.
- Rather than appending to
PATHyou’ve overwritten the variable. Instead you needPATH="$PATH:/usr/sbin/:/usr/local/sbin"(notice$PATH:at the beginning of the assignment).
Also, export is unnecessary since PATH is already an environment variable.
(That’s also bashism but that’s likely an irrelevant issue).