How to reboot CentOS 9 via terminal

Endrit Qerreti

Endrit Qerreti

In this tutorial, you will learn how to reboot CentOS 9 stream.

There are various commands that you can use to reboot your CentOS 9 machine, via the terminal.

Rebooting is required whenever you update your machine or server, in order for the changes to take effect.

CentOS 9, like other linux distros that are systemd based, allows you to reboot via the systemctl commands.

In this tutorial, we'll be rebooting CentOS 9 via the terminal via 4 different methods.

Method 1: Reboot CentOS via reboot command

To reboot CentOS 9 via the reboot command, you can easily do so, by running the reboot command in your terminal.

Assuming you are rebooting your CentOS 9 server, ensure that you are logged in to your server when running the reboot command.

reboot

Method 2: Reboot CentOS 9 via poweroff command

Another way of rebooting in CentOS 9, is by using the poweroff command via the -r option.

poweroff command alone without the -r option, can turn off your CentOS machine, so to reboot your machine via the poweroff command, make sure to pass the -r argument.

poweroff -r

Method 3: Reboot CentOS 9 via systemctl command

CentOS uses systemd when it comes to managing system and its services, which means rebooting can also be done by using the systemctl command.

To reboot CentOS 9, via the systemctl command, simply run the following.

sudo systemctl reboot

Method 4: Reboot CentOS via shutdown command

shutdown also allows you to reboot CentOS 9.

To do so, you need to pass the -r argument which means rebooting when using the shutdown command.

To reboot CentOS 9 via the shutdown command, is quite simple, and it can be easily done by issuing the following command.

shutdown -r

Immediately Reboot CentOS

To immediately reboot your CentOS 9 machine or server, you need to use the --force flag when using one of the rebooting commands we showed in the examples above.

force reboot command allows you to reboot your CentOS 9 machine immediately.

💡
Note: force reboot is only recommended when your system is not responding to a normal reboot command.

reboot --force

Troubleshooting: Reboot command doesn't work

If any of the commands above don't work to reboot your CentOS 9 machine, then you can try to run the command with sudo privileges.

To do so, depending on the reboot command you choose to use, all you need to do is use sudo in front of the command.

For example, to reboot as sudo using the reboot command, run the following.

sudo reboot

Conclusion

In this tutorial, you learned 4 different methods of how to reboot a CentOS 9 machine/server via terminal.