How To Restart/Reboot Linux?

As a flexible operating system, Linux provides a lot of different commands and ways to reboot or restart the system. The restarting Linux and rebooting Linux are the same terms simply used to describe shutting down the Linux and starting it automatically. In this tutorial, we will learn how to reboot/restart Linux with different command-line tools and GUI menus.

Why Reboot Linux?

Linux is known as stable and long running operating system which do not or rerarely requires reboot. But there are some cases we may need to reboot the Linux. Here are some of them.

  • Run Linux system with the new kernel version.
  • Free system resources and start from the scratch.

Reboot/Restart Linux with reboot Command

The original and the most popular command to reboot/restart the Linux is the reboot command. Actually the reboot command is an alias to the shutdown command with the -r option. The reboot command calls “shutdown -r” which is used to reboot system.

reboot

If you get an error or warning related with the privileges you can use the sudo with the reboot command like below.

sudo reboot

Reboot/Restart Linux with shutdown Command

The shutdown command is mainly used to shutdown the system but it can be also used to reboot/restart the Linux. By default the shutdown commands shutdown the system but by using the -r option the system restarted/rebooted.

shutdown -r

After the shutdown command is executed the shutdown/reboot process starts after 1 minute delay. This is also expressed with the following message after the shutdown command.

Reboot scheduled for Sun 2021-01-24 14:07:24 +03, use 'shutdown -c' to cancel.

We can cancel this reboot/restart process by calling following shutdown command with the -c option.

shutdown -c

We can also specify some delay for the reboot/restart proces explicitly. The -t option is used to specify delay. In the following example we will set 5 minutes delay for the reboot/restart.

shutdown -r -t +5

Reboot/Restart Remote Linux with reboot or shutdown Commands

Even the restart and shutdown commands are used to reboot/restart the local Linux system they can be also used to restart/reboot remote Linux box. They can be used with the ssh command and connection in different ways but the most practical way is calling them from the local computer whiout getting an interactive remote SSH shell. In the following example we reboot/restart the remote Linux system which has IP address 192.168.1.10.

ssh [email protected] "/sbin/reboot"

Alternatively the shutdown command can be used too.

ssh [email protected] "/sbin/shutdown -r"

Reboot/Restart Remote Linux with init Command

The init.d is old school system used to manage the Linux system state and services. Very similar to the systemctl it is used to manage service but also can be used to restart the system. The init.d has run levels where run level 6 is defined as reboot. So changing the run level to the 6 restarts the system. The telinit command is used to change the run level.

sudo telinit 6

Reboot/Restart Linux with systemctl Command

The systemctl command if a command provided by the systemd which is used to manage services and system state. Even the systemctl mainly used to manage system services like SSH, NFS, Network etc. it can be also used to manage the system state. The systemctl command cna be used to reboot/restart the Linux system.

sudo systemctl reboot

Reboot/Restart Linux in GNOME Desktop

The Linux can be rebooted or restart by using GUI tools which are provided via desktop environments. GNOME desktop can be rebooted/restart from the left right corner menu Power Off/Log Out -> Restart is selected.

Reboot/Restart Linux in GNOME Desktop

Reboot/Restart Linux in KDE Desktop

KDE Desktop environment is another popular Desktop environment which also provides the Restart function via the Start Menu. First click to the Start Menu icon and then hover to the Leave like below. The last stes is Restart.

Reboot/Restart Linux in KDE Desktop

Leave a Comment