No operating system is perfect. Even if there is one, there could be problems with drivers and apps. Linux is no exception. Although it is more stable than Windows (in many cases, not all!), It is likely a time will come when it is necessary to restart the Linux computer. This could be due to the fact that something is not working. Alternatively, you can connect via SSH to a remote computer or server and want to restart it or turn it off completely.
How To Shut Down A Linux PC That Won’t Turn Off
Have you ever tried to shut down a Linux system, only to find that it refuses to shut it down? We’ve all been there. Even the best open-source technology has problems sometimes. If you are tired of having to press the power switch to turn off an unresponsive Linux PC, or you may not be able to physically shut it down because it is a remote machine, this guide is for you! Here’s how to turn off a PC with Linux that won’t turn off.
Please note that data loss may occur when you shut down a Linux system. Always make sure you regularly back up your data to avoid loss.
Below you can find some of the effective methods that you can try right away to shut down Linux PC.
Method 1 – Poweroff
The first way a Linux system can be turned off is by using the poweroff command. This command immediately turns off your Linux system without warning. To use this command, you need to access an emergency terminal window in TTY mode.
Press Ctrl + Alt + F2 to access TTY mode on your Linux computer system. After opening the TTY emergency console, search for the login screen and type “root” as a user. As an alternative, use a username if the root account is disabled.
If you are logged in with the root account, enter poweroff in the command line console to turn everything off immediately.
Or, do sudo -s to get root access with a normal user, so do:
Can’t access TTY because you’re using a dial-up connection? Get root on your remote SSH console with:
Then, with root access, type the shutdown command to immediately shut down the remote computer.
Method 2 – Reboot
Rebooting is another way to take control of a Linux system and force it to reboot. You may want to use this method, unlike stopping, because sometimes the command of poweroff has difficulty working.
To use the reboot command, you must have access to the TTY console. Press Ctrl + Alt + F2 on the keyboard to access it. Then, when the command line console is displayed, enter “root” in the userbox to log in with root access. If you have disabled root access, log in with a traditional user account.
With the root account started, use the command of reboot to restart the Linux system, forcing it to shut down and then turn it back on.
The reboot command also has the ability to completely shut down a system, with the help of a command-line switch. This switch, named as “f”, will tell the reset command to shut down the Linux system completely, instead of restarting it. To use it, enter the following command.
Do you use a traditional user account instead of the root user? do:
Or shutdown Linux system with:
sudo reboot -f
Those who cannot use TTY mode must execute the following commands in a terminal session. Make sure you use “-f” if you want the reboot command to force a shutdown.
Or you can also try
Method 3: systemctl poweroff/reboot
Nowadays the Systemd init system is integrated into most Linux operating systems. One of the most important advantages of using the Systemd init system is that it has many uses that are easy to understand since the command line syntax is simplified.
If you are trying to shut down a PC with Linux and you cannot use the above-mentioned commands, using systemctl poweroff is as good as it says to the Systemd boot system (the tool that helps your Linux system to turn on and turn itself off and does many other things to turn everything off.
Like all the other commands, the best way to force a system to stop, especially if it is blocked or not responding, is to access the TTY emergency console by pressing Ctrl + Alt + F2.
Once the TTY emergency console is on the screen, enter “root” in the userbox to log in to the root account and access the root command line. Alternatively, log in with a traditional user if the root account cannot be used. From there, run the systemctl poweroff command to instantly turn everything off.
Or, if you’re using a traditional user, follow these steps:
sudo systemctl poweroff
Can’t use TTY mode? Enter the following commands in an SSH terminal.
The Systemd shutdown command forces everything to shut down, but if that doesn’t work, try trying the systemctl reboot command to force the machine to reboot.
Or, for a traditional user, use the sudo command.
sudo systemctl reboot
Finally, if you can’t access TTY mode to restart, try the following command below.
- View Full Version of Facebook on iOS Devices
- Repair Corrupted Pen Drive or SD Card In Simple Steps [ Quick Guide ]
- Now You Can Force Enable Google Chrome Dark Mode On Windows 10
If you have any query feel free to drop that in the comment section and Visit ATechGuides for more information.