How to fix bash: reboot: command not found error on Debian 12

Endrit Qerreti

Endrit Qerreti

reboot is a simple command that is used to reboot your machine. On Debian 12 this command doesn't work when you execute it because reboot is not a known command to the system.

If you run reboot on your terminal, you get the error

bash: reboot: command not found

To explain it in a simpler way, reboot command is a symlink of /sbin/reboot so when you call reboot it is supposed to execute /sbin/reboot . However, since PATH is not configured, the system doesn't know which path should be used for the reboot command.

To fix this error, you need to configure the PATH on your system, so you don't have to run the full path of a command in order to execute it.

In this tutorial, you will learn how to fix the error "bash: reboot: command not found" on Debian 12.

1) Configure PATH on Debian 12

To add PATH on your ~/.bashrc file, all you have to do is run the command below

sh -c 'echo "export PATH=$PATH:/usr/sbin" >> ~/.bashrc'

The command above will add a permanent PATH to your PATH variable, so you will be able to use the reboot command even after rebooting.

2) Verify PATH

Now you need to verify that the right PATH was added on your ~/.bashrc file. To do this, simply view the content of the ~/.bashrc file using the cat command

cat ~/.bashrc

Scroll down to the end, and you should see the line below

3) Use reboot command

Now that the PATH is configured on your system, you can run the reboot command directly from your terminal, and reboot your machine without having to use the full path of the reboot command.



In this tutorial, you learned how to fix the error "bash: reboot: command not found" on Debian 12.