I'm trying to reboot my Debian 10 server but all I get is "Command not found. I've tired


but nothing works. I found this thread but when I try to run any of this with sudo I get bash: sudo: command not found. Atm I'm logged in as root so I should have the privileges to restart the machine.\n Any Ideas?

  • Maybe your PATH is empty or messed up. /sbin/reboot should work. If it works, do you still get command not found for many commands after the reboot? Jul 22, 2019 at 8:30
  • Its a VM where I want to try my new coded C# apps with Mono so I don't use many commands there. I can say that apt, apt-get, su and wget works. So I tried it with your version and it works fine on the machine itself. After the reboot it works with putty too. It was the first start after the installation. Coud whis cause the problem?
    – BDevGW
    Jul 22, 2019 at 8:39

7 Answers 7


The trick on how to fix this inconvenience is to explicitly tell the su to set environment variable as if the user logs in directly. This is can be done by the use of - switch.

$ su -


Debian 10 has now fully switched to Systemd which means that the traditional commands to halt or reboot a system like 'shutdown -h now' or 'reboot' will not work anymore


Starting with Debian 10, you should use the commands systemctl poweroff or systemctl reboot.

Edit: It appears the above source was partially incorrect, you can still log in as root (see answer by Eugene) to run the old commands. If you don't want to log in as root, use systemctl.


  • 1
    I wasn't able to get CRON to reboot my system - indeed using systemctl reboot in the cronjob worked.
    – Koen
    Nov 21, 2020 at 15:21
  • 1
    or just sudo apt install systemd-sysv to get the symlinks back
    – reukiodo
    Oct 24, 2021 at 3:27

As 'root' -> 'systemctl poweroff' or 'systemctl reboot'

  • 2
    Why, what does this do, explain with more detail. Aug 29, 2019 at 15:01
  • @GammaGames your edit was rejected because it substantially changed the post. Your info is good and so should be its own answer. Please post your own answer. Nov 14, 2019 at 18:47
  • @music2myear thank you, the reject reasons were generic and did not seem to match your explanation. I have submitted an answer.
    – GammaGames
    Nov 14, 2019 at 18:54

As 'root' -> Edit /root/.bashrc

Add to the end of the file:

alias reboot='systemctl reboot'
alias poweroff='systemctl poweroff'

Save the file and start session as root again.

  • or just sudo apt install systemd-sysv to get the symlinks back as a properly managed package
    – reukiodo
    Oct 24, 2021 at 3:29


nano /bin/reboot

add line: systemctl reboot

exit and save

chmod to your preffered execution level

I'm sure there is a more elegant way to fix this but I am going to have a hard time remembering that only debian 10 requires a special reboot command. This works for me as long as i'm in su first.


Use /sbin/shutdown [OPTIONS...] [TIME] [WALLMSG] :)


Use command to reboot immediately.

reboot -f

if above command doesn't work due to some kernel issue then you below command.

systemctl reboot to reboot or systemctl poweroff to shutdown the system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.