The โupdate-grubโ command, commonly used to apply changes made to the GRUB on Linux, was not available on my newly switched vanilla Arch system.

Initially, I was quite surprised because I remember selecting GRUB during installation, and the GRUB screen also appeared on system boot, but later I discovered the reason after switching to Ubuntu, where this command is available.
So, the reason for the unavailability of this command on Arch was that itโs not a standard Linux command like ls, cd, find, etc., whose binary files are available in the system directory. Of course, itโs a script file in the โsbinโ directory on Ubuntu, but itโs nothing more than an alias to the โgrub-mkconfigโ command.
$ sudo grub-mkconfig -o /boot/grub/grub.cfgTo solve this problem, you can either directly run the above command, but as you can see, itโs a long command to remember, so you can create a custom โupdate-grubโ command to run the same.
How to Solve โupdate-grub: command not foundโ Error on Linux
To resolve this issue, we will create the same โupdate-grubโ script file in the โsbinโ directory as in other Linux distributions, such as Ubuntu. So, open your terminal and execute the following command:
$ sudo nano /usr/sbin/update-grub
#OR
$ sudo vim /usr/sbin/update-grubThe above command will create a blank โupdate-grubโ file in the โ/usr/sbinโ directory using your selected Nano or Vim editor. You can now copy and paste the following line into the script file above.
#! /bin/sh
set -e
exec grub-mkconfig -o /boot/grub/grub.cfg "$@"To save the file, if youโre using Nano editor, press โCtrl+Oโ, hit โEnterโ, and then โCtrl+Xโ. If youโre using the Vim editor, enter in command-line mode and then type and enter the โ!wqโ command.
Finally, change the file ownership to the root user using the chown command and assign read-write permission using the chmod command:
$ sudo chown root:root /usr/sbin/update-grub
$ sudo chmod 755 /usr/sbin/update-grubOnce done, โupdate-grubโ command will become accessible, and you can run it as a root user or with sudo privileges.
$ sudo update-grubOutput:

Thatโs it. I hope you find this article helpful. If youโre still stuck with the same error or have any queries related to the topic, do let me know in the comment section.
Till then, peace!





I wrote several times and it says that
/usr/sbin/update-grub: line 3: exec: grub-mkconfig: not found