Debian

How to Reboot Debian

Rebooting your Debian system is an important task that helps you solve issues related to sound, package updates, or apply changes to the system after the configuration. A system reboot also improves the overall performance of your system as it gives the system a fresh start. While it looks like a simple and straightforward task to reboot the system, it is crucial for the Debian users to reboot their systems in a safe manner to protect them from accidental failure.

In this guide, you will learn:

How to Reboot Debian

Conclusion

How to Reboot Debian

You can reboot Debian from:

  • Command Line
  • GUI

How to Reboot Debian from Command Line

There are several commands to reboot Debian from the command line, which are given below:

  • reboot Command
  • systemctl Command
  • shutdown Command
  • /sbin/reboot Command
  • /sbin/init Command
  • proc Command

How to Reboot Debian from Command Line Using reboot Command

The reboot command is a widely used command that allows users to safely reboot Linux systems including Debian from the command line. It offers two usage options, either execute the command directly using:

reboot

Or you can run the reboot command with sudo privilege, as given below:

sudo reboot

In both cases, your Debian system will reboot immediately.

How to Reboot Debian from Command Line Using systemctl Command

systemctl is a commonly used Linux command that allows you to manage systemd services and units. With systemctl command, you can start, stop, enable, disable or check the status of the services running on your system.

Beside managing the services, you can also use systemctl command on Debian in the following way to reboot the system safely:

sudo systemctl reboot

The above command will send a signal to the kernel as soon as you execute the command which will cause the Debian system to reboot.

How to Reboot Debian from Command Line Using shutdown Command

Besides using the reboot command, you can also alter the shutdown command to reboot your Debian system safely. By default, the shutdown command will turn off your system, but if you use -r flag with the shutdown command, it will work as a restart command. However, you have to specify the restart time with the command to allow the system to schedule a restart at a specified time interval.

If you want to immediately restart your system, you can use the shutdown command in the following way:

shutdown -r now

However, if you want to specify a time interval, you can add a time in place of the now keyword, such as the following command will restart the system after two minutes.

shutdown -r +2

Note: The shutdown command will not work if you are using Debian 10 or later because of its symbolic link to systemctl.

How to Reboot Debian from Command Line Using /sbin/reboot Command

Besides using the reboot, systemctl and shutdown commands, you can also use the /sbin/reboot command to reboot your Debian system safely without any delay. It is a low-level command that interacts with the system Kernel and forces it to initiate the reboot process:

/sbin/reboot

How to Reboot Debian from Command Line Using /sbin/init Command

The /sbin/init is an executable file on Linux systems including Debian that plays an important role in initiating the reboot or shutdown process. When you execute the /sbin/init command on the terminal with the number 6, it gracefully terminates the process running on your system, unmounts the file systems and halts the Kernel, causing your system to reboot.

/sbin/init 6

How to Reboot Debian from Command Line Using proc Command

The proc is a built-in virtual file system that informs Linux users about the activities of the system Kernel. It is mounted on /proc by default and you can access it from the file system commands like cat, echo or ls.

If you want to utilize the proc command to reboot your Debian system, you have to first enable the SysRq key which is used to perform certain actions on your system including system reboot as well.

To enable SysRQ key on Debian, first login to root user using the following command:

sudo su

Then enable the SysRq key by writing the value 1 to the /proc/sys/kernel/sysrq file, as shown below:

echo 1 > /proc/sys/kernel/sysrq

Once enabled, you can then use the following command to reboot the Debian system using the SysRq key:

echo b > /proc/sysrq-trigger

How to Reboot Debian from GUI

If you are using Debian desktop, you can simply reboot the system from GUI using the following steps:

Step 1: Click on the Power sign button at the top right corner of your Debian desktop, then press the Power sign button again:

Step 2: Now select the Restart option from the Power Off menu:

Step 3: Select the Restart button again to reboot your Debian system:

Conclusion

Rebooting a Debian system is a common task that most users do either through terminal or GUI. The terminal method involves several commands to reboot the Debian system. These commands include reboot, systemctl, shutdown, /sbin/reboot, /sbin/init and proc. All these commands will help you reboot the system quickly directly from the terminal. You can also use the Power Off menu from the Boot button on Debian desktop to restart your system. A detailed step-by-step guide to reboot Debian systems in different ways is already provided in the above sections of this guide.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.