50

I'm trying to reboot my Debian 10 server but all I get is command not found.

I've tried:

shutdown
reboot
restart
poweroff

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. At the moment I'm logged in as root so I should have the privileges to restart the machine.

Any ideas?

Destroy666
  • 12,350
BDevGW
  • 655

8 Answers8

61

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

source

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.

source

48

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 -
Benjamin Loison
  • 183
  • 1
  • 6
10

As root -> systemctl poweroff or systemctl reboot.

Benjamin Loison
  • 183
  • 1
  • 6
6

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.

Benjamin Loison
  • 183
  • 1
  • 6
0

Try:

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.

Benjamin Loison
  • 183
  • 1
  • 6
0

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

0

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.

0

saya mempunyai masalah yang sama, akan tetapi saya menemukan artikel di : https://www.tembolok.id/cara-mengatasi-linux-mint-tidak-bisa-shutdown/

dengan melakukan perubahan di folder /etc/default/grub menggunakan teks editor vi / gedit, kemudian lakukan perubahan pada teks berikut: sebelum : GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash “ sesudah : GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash acpi=force”

======================================================== I had the same problem, but I found the article at: https://www.tembolok.id/cara-mengatasi-linux-mint-tidak-bisa-shutdown/

by making changes in the /etc/default/grub folder using the text editor vi / gedit, then make changes to the following text: before : GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash” after : GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash acpi=force”

enter image description here