Or copy link
Copy link
Restarting Ubuntu after updates, troubleshooting, or routine maintenance is a common practice. It ensures that any changes, such as software updates or configuration modifications, are fully applied, which helps the system run smoothly and efficiently. Moreover, regular reboots are also beneficial for maintaining system health and avoiding problems caused by extended uptime.
Rebooting Ubuntu through the GUI is straightforward, however, if we’re working on a CLI-based Ubuntu server, we can use specific commands to restart the system. In this tutorial, we’ll discuss several commands to reboot Ubuntu from the terminal.
Ubuntu supports the reboot command, which allows us to restart the system directly from the terminal. It is a convenient and safe way to reboot Ubuntu from the terminal. This command helps protect our data and ensures the system remains intact during the restart. When we run the reboot command, it sends a signal to the system to reboot, causing all running processes and applications to terminate before the system restarts.
The reboot command can be used to restart the system immediately or after some delay. To restart it immediately, we need to run the following command:
sudo reboot now
When we run this command, it asks us to provide the password for the user “anees”. Specify the password and hit the Enter key to restart Ubuntu immediately:
However, if we run the reboot command without any argument it will restart the system after a delay of a few seconds:
sudo reboot
In addition to this, we can force Ubuntu to reboot, but this is not recommended as it can result in the loss of unsaved data. For this purpose, run the reboot command with the “-f” option:
sudo reboot -f
Restarting Ubuntu From the Terminal Made Easy!
Knowing how to restart Ubuntu from the terminal is essential for troubleshooting, software updates, or rebooting your server. Enhance your Ubuntu experience with our customizable Ubuntu VPS.
Ubuntu provides a shutdown command that is specifically designed to power off the system. However, we can run this command with the “-r” option to reboot Ubuntu from Terminal:
sudo shutdown -r
When we run this command, it instructs the system to reboot immediately. However, we can also use this command to schedule a reboot:
sudo shutdown -r + min
Here, min represents the minutes after which the system reboots. For instance, the below-mentioned command sets the system to restart in four minutes:
shutdown -r +4
We can also cancel the scheduled reboot by running the “shutdown” command with the “-c” option, as shown below:
Read also How to Install Unity on Ubuntu
Another way to restart Ubuntu from the terminal is using the “systemctl reboot” command. This command gracefully terminates all processes, services, and applications before restarting the system. To restart Ubuntu using systemctl, run the following command from the terminal:
sudo systemctl reboot
The above-mentioned command utilizes the systemd utility to trigger a controlled system reboot.
Ubuntu supported a command-line utility called init to restart the system from the terminal by using runlevel 6. The init command was widely used in earlier Ubuntu versions (with SysVinit) and other Linux distributions to restart the system. However, recent Ubuntu releases primarily utilize systemd, where the “systemctl reboot” command is preferred. To use this command on Ubuntu, type init followed by 6 and then hit enter key:
sudo init 6
We executed this command on Ubuntu 24.04 (the latest Ubuntu version as of August 2024), and it worked perfectly fine.
The telinit command works similarly to the init command. We can use this command to reboot Ubuntu from the terminal. When we execute “telinit 6” from the Ubuntu terminal, it terminates running processes and reboots the system:
sudo telinit 6
However, it is important to note that modern Linux distributions like Ubuntu use systemd, where “systemctl reboot” is the recommended command.
The REISUB sequence is a method for rebooting a system in emergency situations, particularly when the system becomes unresponsive. It’s a series of keystrokes that forces a reboot, even if the system is unresponsive. Let’s understand the working of each keystroke one-by-one:
To use the REISUB sequence in Ubuntu, first, open the terminal, press and hold the “Alt+Prtsc” keys on the keyboard and then type REISUB in sequence:
ALT + PRTSC + REISUB
Alternatively, we can run the “echo b | sudo tee /proc/sysrq-trigger” command to invoke the REISUB sequence directly from the terminal. This command sends a signal to the kernel to initiate a reboot without going through the REISUB keystrokes.
Restarting an operating system ensures that the system runs smoothly. The GUI makes it easy to do, but the command line provides more control and options. In this tutorial, we’ve covered several ways to reboot Ubuntu from the terminal. These methods include using the reboot, shutdown, systemctl, init, and telinit commands. We’ve also explored the REISUB sequence. You can use the command that best fits your needs.
If you’re new to Linux, it’s important to make sure your setup aligns perfectly with your needs. Ultahost can help you with that. We provide Linux VPS hosting with reliable resources, ensuring your tasks run smoothly and quickly.
Yes, we can use commands like reboot, shutdown, systemctl, init, and telinit to restart Ubuntu from the terminal.
We can execute the “sudo reboot now” command to restart Ubuntu instantly.
To schedule a reboot, we can use the “shutdown -r +min” command, where “min” specifies the number of minutes after which the system restarts.
We can execute the “sudo shutdown -c” command to cancel a scheduled reboot.
Yes, we can restart an Ubuntu server remotely. For this purpose, open a terminal on the local machine and use the “ssh [username]@[remote_server_ip]” command to connect to the remote server. Once connected, use the reboot command to restart it remotely.
The reboot command is a convenient and safe way to restart Ubuntu from the terminal. It reduces the chances of data loss and maintains system integrity during the restart process.
Yes, we can force a reboot using the “sudo reboot -f” command, but it’s not recommended as it can lead to data loss.
PHP is a popular language used for creating dynamic web...
PowerDNS is a powerful and flexible DNS server that off...
When it comes to development environments, consistency,...
Python is a powerful and versatile programming language...
Django is a popular web development framework used on t...
If you’re a software developer, you know the importan...
Save my name, email, and website in this browser for the next time I comment.
Δ